MySQL is dumb
Why oh why is MySQL so dumb? If you are executing a query similar to:
SELECT * FROM table ORDER BY field1*field2 LIMIT 1
I.e. you are selecting the one row that maximises (or minimises) some calculated expression, it will calculate the values of this expression for each row, put them into a temporary table and then filesort it. What a ridiculous waste of time! Its elementary to see that it could select the row as it calculates the expression, without the need for a sorting stage. Grrr…..
Advertisement









