Indexed ORDER BY with LIMIT 1
I'm trying to fetch most recent row in a table. I have a simple timestamp created_at which is indexed. When I query ORDER BY created_at DESC LIMIT 1 , it takes far more than I think it should (about 50ms on my machine on 36k rows). EXPLAIN -ing claims that it uses backwards index scan , but I confirmed that changing the index to be (created_at DESC) does not change the cost in query planner for a simple index scan . How can I optimize this use case? Running postgresql 9.2.4 . Edit: # EXPLAIN SELECT * FROM articles ORDER BY created_at DESC LIMIT 1; QUERY PLAN -----------------------------------