I have a table created with an auto-increment id as a column which is also the primary key. I want to know the most efficient way to retrieve the last 100 tuples from the table (preferably O(1) time as my table is going to be huge).
Also, since id is my primary key here, will it automatically indexed? And does id being indexed result in any performance gain in retrieving the last 100 tuples?
UPDATE
Yes, your primary key will be indexed which speeds up queries using it.