What would you expect? You ask for the whole file, and then ask that it be sorted by two fields. How do you expect this to happen without a temp file?
Tiago Antao wrote: > Hi! > > I have a very simple query > SELECT a, b FROM t ORDER BY a, b > I also have an index on t(a) > I have run ANALYZE > Also the number of repetitions of values of a in t is very low. > > My view is that the execution should require little temporary space > and little time, something like: > for each different a(already ordered and of fast access from index) { > get all rows (usually 3/4, max arround 300) > sort this (little) subset > } > > What is happening is that a tmp file of the size of the t is being > generated. > > Is there any thing that I am not seeing? I there any way to change > this behaviour? > > Thanks, > Tiago --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php