How to fix ERROR 1104: SELECT would examine too many rows in MySQL | DevErrors