Where execution is executed from left to right, not when the amount of data is small, but when there is a lot of data to consider the order of the conditions, you should follow a principle: the more conditions to exclude the first one.
When querying the database with MySQL, a lot of filters were connected and found to be very slow. For example: SELECT ... where P.languages_id=1 and T.type=1 and p.products_id in (472,474), so that the query takes more than 20 seconds, although indexes are established on each field. Using the analysis of explain SQL, we found that tens of thousands of data were returned during the first analysis: where p.languages_id=1, then narrow the range according to the conditions in turn.
And then slightly change the location of the where field, the speed is significantly improved: where p.products_id in (472,474) and p.languages_id=1 and t.type= 1, so the first filter condition is p.products_id in (472,474), it returns less than 10 results, followed by other conditions to filter, natural speed has a greater increase. In practice, don't assume that the order of the fields in the where can be arbitrarily placed, you should filter out most of the useless data the first time possible, and only return the smallest range of data.
MySQL where execution order