Table has two columns:
CREATE TABLE items (
k INT auto_increment PRIMARY KEY,
val INT UNSIGNED
) ENGINE=MyISAM;
I put four items in the table:
INSERT INTO items (val) VALUES (12),(23),(45),(56);
Now if I do:
EXPLAIN SELECT * FROM items ORDER BY k;
I get the dreaded "using filesort". What's going on? According to this page, it should be using the index for the ordering. Am I doing something wrong?
Tested on MySQL 5.0.41 on XP and 5.0.67 on ubuntu.
UPDATE: I added 1,110,000 rows to the table, I added a VARCHAR column and filled it with text. The table size is now 135MB, and I'm still getting "using filesort".
- Anyone has any tips as to how to add lots of rows quickly?
- At what point should I consider a table "large enough" for query optimization testing?