Re: Slow query - index not used - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Slow query - index not used
Date
Msg-id 27761.1074642972@sss.pgh.pa.us
Whole thread Raw
In response to Slow query - index not used  (Michael Brusser <michael@synchronicity.com>)
Responses Re: Slow query - index not used  (Michael Brusser <michael@synchronicity.com>)
List pgsql-hackers
Michael Brusser <michael@synchronicity.com> writes:
> Using "DEFAULT_STATISTICS_TARGET = 100" made db use index for 
> field = 'abc', but field = 'xyz' still results in the table scan.

What's the actual distribution of values in these columns?  Are you
searching for values that are particularly common or uncommon?

> Also 'rows' number reported in the plan is way off.

That would seem to be the crux of the problem, but you'd better be more
specific than "way off".
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Allow backend to output result sets in XML
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: Old binary packages.