I would like to perform a SQL query across a very large table. However, I only need to look through the last 100,000 rows. Currently:
SELECT * FROM bigtable WHERE columna='foobar' ORDER BY id DESC LIMIT 10
I would like to do the same but make it only look in the last X ids.
EDIT: Selecting 100k rows first and then selecting it from that is not a solution. This selects the full previous 100k rows, even if more than 10 of the needed rows have been found. That makes it slower.