I’m having a table with 1M rows and i’m always fetching the rows that was just inserted (auto_increment) and the queries get slower the more rows i’ll insert. Can i query the last 10 “content” without using ‘ORDER BY’ ?
mysql> describe logfile\G*************************** 1. row *************************** Field: id Type: int(11) Null: NO Key: PRIDefault: NULL Extra: auto_increment*************************** 2. row *************************** Field: content Type: varchar(5000) Null: YES Key:Default: NULL Extra:
And my query:
mysql> SELECT content FROM logfile ORDER BY id DESC LIMIT 20;