# Optimizing simple order by query

**URL:** <https://forums.percona.com/t/optimizing-simple-order-by-query/987>\
**Category:** Other MySQL® Questions\
**Created:** [November 3, 2008, 6:23pm UTC](https://forums.percona.com/t/optimizing-simple-order-by-query/987 "2008-11-03T18:23:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![novice.program](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@novice.program](https://forums.percona.com/u/novice.program)\
**Post date:** [November 3, 2008, 6:23pm UTC](https://forums.percona.com/t/optimizing-simple-order-by-query/987/1 "2008-11-03T18:23:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![xaprb](https://avatars.discourse-cdn.com/v4/letter/x/49beb7/32.png) [@xaprb](https://forums.percona.com/u/xaprb)\
**Post date:** [December 25, 2009, 10:31am UTC](https://forums.percona.com/t/optimizing-simple-order-by-query/987/2 "2009-12-25T10:31:01Z")

</div>

Try FORCE INDEX.
