Situation
I have a table called follow
and this is the table structure:
- follower_id
- following_id
- when // timestamp
These are the SQL Queries I execute:
SELECT * FROM follow WHERE follower_id = ? ORDER BY when LIMIT 0,20
SELECT * FROM follow WHERE following_id = ? ORDER BY when LIMIT 0,20
SELECT * FROM follow WHERE follower_id = ?
SELECT * FROM follow WHERE following_id = ?
and these are my indexes:
follower_id, when
following_id, when
follower_id
following_id
Question
Is this approach true? And is there any disadvantage of having this amount (or more than this) of indexes in DB ?