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.
not actually. it’s the approximate (optimizer cannot say the correct number in many different cases) number of rows that potentially will be scanned. but you specified
LIMIT– so only first 16 rows will be affected while query executed.ps: i hope the used key in EXPLAIN is
id?