Does MySQL short-circuit the ORDER BY clause?

Posted by nickf on Stack Overflow See other posts from Stack Overflow or by nickf
Published on 2010-04-14T23:58:44Z Indexed on 2010/04/15 0:03 UTC
Read the original article Hit count: 275

Filed under:

Given this SQL:

SELECT * FROM mytable ORDER BY mycolumn, RAND()

Assuming that mycolumn happens to only contain unique values (and hence, contains enough information to perform the ORDER BY), does MySQL short-circuit the operation and skip evaluating the rest?

© Stack Overflow or respective owner

Related posts about mysql