Mysql Order by clause using "FileSort"

Viewed 12021

I have a table structure like

comment_id primary key
comment_content 
comment_author
comment_author_url

When I fire query like

explain SELECT * FROM comments  ORDER BY comment_id

It outputs the results as

id  select_type     table   type    possible_keys   key     key_len     ref     rows    Extra
1   SIMPLE  comments    ALL     NULL    NULL    NULL    NULL    22563   Using filesort

Why is not able to find the index that I have defined as Primary Key?

2 Answers
Related