I have yet to figure out how to use a few tips. MySQL will almost never use more than one index per SELECT . The only exception that I know of is "index merging", which doesn't matter in your example.
The optimizer usually focuses on finding a good index for the WHERE . If it completely covers WHERE , without any "ranges", it checks to see if <23> and ORDER BY fields are in the correct order. If it can handle all WHERE, GROUP BY, and ORDER BY , then it can actually optimize LIMIT (but not OFFSET ).
If the optimizer cannot use all of the WHERE , it may end up in ORDER BY in the hope of avoiding the "filesort", which otherwise requires ORDER BY .
None of this allows using different indexes for different sentences. One hint may facilitate the use of one of the above cases (see above) compared to another; I dont know.
Do not use utf8 for zipcode; it makes things more bulky than necessary (3 bytes per character). In general, reducing the size of the table will help some. Or, if you have a huge dataset, this can help a lot. (Avoiding I / O is very important.)
Bathrooms not very selective; there is nothing to win, even if it were possible.
az.application_id - the big monkey key in the request; what is it?
source share