OneWheeledBicycle

Random mutterings of Alastair James

MySQL is dumb

leave a comment »

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

Written by aljames

September 5, 2007 at 1:58 am

Posted in Mysql, Rant, Tech

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.