Home » Performance » MySQL » Optimizing simple order by query
Optimizing simple order by query [message #3686] Mon, 03 November 2008 18:53
novice.program  is currently offline novice.program
Messages: 1
Registered: November 2008
Junior Member
Hello I am having problems in optimizing a simple order by clause.

the query is:
explain SELECT `Entity`.`title`, `Entity`.`description`, `Entity`.`user_id`, `Entity`.`thumb_url`, `Entity`.`entity_uid`, `Entity`.`num_fachaks`, `Entity`.`number_of_views` FROM `entities` AS `Entity` ORDER BY `Entity`.`created` DESC LIMIT 21 \G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: Entity
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 11
Extra: Using filesort

I have index on the created filed by really dont understand that why mysql does not use it and prefers file sort.. the created field is a timestamp default current_timestamp.

Please help ... i am new to mysql and badly stuck.

Thanks.
Previous Topic:Increasing performance by parallel processing or multiple mysqld
Next Topic:ERROR 1041 (HY000) OutOfMemory
Goto Forum:
  


Current Time: Thu Jul 9 19:50:56 EDT 2009

Total time taken to generate the page: 0.01001 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software

MySQL is a trademark of Sun Microsystems.
InnoDB is a trademark of Oracle Corp.

Percona Performance Forums are a service of Percona, Inc.
Not affiliated with Sun Microsystems or Oracle Corp.