Using filesort

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jan Persson

    #1

    Using filesort

    Hi,

    I am having trouble optimizing the query:

    select * from article order by article_id;

    for a MyISAM table that looks like this:

    CREATE TABLE `article` (
    `id` int(11) NOT NULL auto_increment,
    `thumburl` varchar(255) default NULL,
    `thumb` text,
    `descr` text,
    `news_group_id` int(11) default NULL,
    `picurl` varchar(255) default NULL,
    `article_id` int(11) NOT NULL default '0',
    `size` varchar(20) default NULL,
    PRIMARY KEY (`id`),
    KEY `index1` (`article_id`),
    KEY `index2` (`id`)
    );

    If I do an "explain select * from article order by article_id" it says
    "Using filesort" and I can not understand why in the world it is not using
    index1.

    Any ideas? Right now I'm using the 4.0.15-nt, but I have also tried this in
    the 4.1 tree with the same results. I have also tried using "FORCE INDEX".

    Any help will be much appreciated.

    Kind regards
    //Jan Persson
Working...