I have three tables. One table has information on users, such as their name, bio, age etc. The primary key is the Id field alone. Second table shows people users follow (user_following) and the third table is to store relations with people who follow me (user_followers).
I want to find information on those users who have been removed from both the tables.
Users can have large IDs and hence the ID column is varchar with the lenght being max 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
Attached is the explain results of this query:
Is there a way to improve the performance here?