On Thu, Jan 6, 2011 at 4:36 PM, Mike Broers <
mbroers@gmail.com> wrote:
> Thanks for the assistance.
> Here is an explain analyze of the query with the problem limit:
> production=# explain analyze select * from landing_page.messages where
> ((messages.topic = E'x') AND (messages.processed = 'f')) ORDER BY
> messages.created_at ASC limit 10;
>
> QUERY PLAN
>
> --------------------------------------------------------------------------------------------------------------
> ------------------------------------------------------------
> Limit (cost=0.00..2891.06 rows=10 width=1340) (actual
> time=207922.586..207922.586 rows=0 loops=1)
> -> Index Scan using idx_landing_page_messages_created_at on messages
> (cost=0.00..449560.48 rows=1555 widt
> h=1340) (actual time=207922.581..207922.581 rows=0 loops=1)
> Filter: ((NOT processed) AND ((topic)::text = 'x'::text))
> Total runtime: 207949.413 ms
> (4 rows)
You're not the first person to have been bitten by this. The