I have some tables that are lookup tables. They contain a set of IDs, with text representations for them and they are joined against a table with the IDs. This seems like a pretty common thing.
Somethign like this:
STATUSES
STATUS_ID TEXT
1 Deleted
2 Viewed
3 Unread
MESSAGES
MESSAGE_ID STATUS_ID
1 1
2 1
3 2
4 3
When I enable “log queries not using indexes” the queries with the status_id table, are showing up in the slow query log as not being indexed.
Anyone know why?
My hunch is that the optimizer knows it needs every row and doesn’t use the index… but that seems odd.