2012/1/17 Filip RembiaĆkowski <plk.zu...@gmail.com>: > postgres will still try to choose best execution plan. seq scan may simply be > faster here. breaking point is somewhere near 50% selectivity.
The tipping point is usually far lower than that; in fact, it's more often around 10%. Random IO is *very* expensive, as compared to sequential IO (at least on spinning rust; SSDs are a different matter, of course). It's usually vastly cheaper to read in an entire table and filter the rows you want than to seek left and right (and then left, left, and right again) to cherry-pick the pages you need. rls -- :wq -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql