Recently I did tests on a database with a query using two clauses where AND. I noticed that there was a significant difference using clause A before B and vice versa.
Intuitively, it would be faster to use FIRST the more restrictive criterion, since it would have a smaller set to it then apply the second criterion. For example, based on the economically active Brazilian population, if I want to get all records of 'male' sex with 'income greater than 1 million dollars' it would be faster for me to first filter the records by income to only filter after sex .
Can anyone explain me?
UPDATE (1)
I'm using MySQL 5 in my tests.