Search Postgresql Archives

Re: select distinct and index usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"David Wilson" <david.t.wilson@xxxxxxxxx> writes:
> It appears to be doing a sequential scan regardless of the set, as if
> it doesn't believe it can use the index for some reason

More likely, it's getting a cost estimate for the indexscan that's so
bad that it even exceeds the 100000000-unit thumb on the scales that's
inserted by enable_seqscan=off.

You could try setting enable_sort=off also, which'd give you another
100000000 worth of thumb on the scales.  And if that doesn't help,
reduce random_page_cost to 1 or even less.

What I think you'll find, though, is that once you do force an indexscan
to be picked it'll be slower.  Full-table index scans are typically
worse than seqscan+sort, unintuitive though that may sound.

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux