You probably need to run vacuum analyze after filling in the data.
Otherwise it's using bogus selectivity (see the number of expected
rows returned by the explain output, it's expecting 6000 rows after
the create index, which is large enough to make it guess that
it'll be cheaper to sequence scan
Hi,
I found a case where psql 7.1.3 doesn't use indices when the number of
rows is very large.
In the FIRST SESSION (below) I create the table foo and fill it with
200 rows. Then, I create an index in the 'bar' field and run some
explains and they all return 'Index Scan'. So far, everything is