I have three tables A table has information about users, such as their name, biography, age, etc. The primary key is just the ID field. The second table shows the people that users follow (user_following) and the third table is for storing relationships with people who follow me (user_followers).
I want to find information about those users that have been removed from both tables.
Users can have large IDs and, therefore, the ID column is varchar with a maximum length of 25 characters as of now.
My query is this:
select * FROM followers_info finfo LEFT JOIN user_followers uf ON uf.follower_id = finfo.follower_id LEFT JOIN user_following fing ON fing.follower_id = finfo.follower_id WHERE uf.follower_id IS NULL AND fing.follower_id IS NULL
The explanatory results of this query are attached:
Is there any way to improve performance here?