mysql query optimization
Posted
by vamsivanka
on Stack Overflow
See other posts from Stack Overflow
or by vamsivanka
Published on 2010-05-07T02:46:13Z
Indexed on
2010/05/07
2:48 UTC
Read the original article
Hit count: 251
I would need some help on how to optimize the query.
select * from transaction where id < 7500001 order by id desc limit 16
when i do an explain plan on this - the type is "range" and rows is "7500000" According to the some online reference's this is explained as, it took the query 7,500,000 rows to scan and get the data.
Is there any way i can optimize so it uses less rows to scan and get the data. Also, id is the primary key column.
© Stack Overflow or respective owner