Re: Re: [GENERAL] Performance issue with libpq prepared queries on 9.3 and 9.4 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: [GENERAL] Performance issue with libpq prepared queries on 9.3 and 9.4
Date
Msg-id 27290.1415926044@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Performance issue with libpq prepared queries on 9.3 and 9.4  (David G Johnston <david.g.johnston@gmail.com>)
Responses Re: Re: [GENERAL] Performance issue with libpq prepared queries on 9.3 and 9.4  (David Johnston <david.g.johnston@gmail.com>)
List pgsql-hackers
David G Johnston <david.g.johnston@gmail.com> writes:
> Tom Lane-2 wrote
>> In the meantime, I assume that your real data contains a small percentage
>> of values other than these two?  If so, maybe cranking up the statistics
>> target would help.  If the planner knows that there are more than two
>> values in the column, I think it would be less optimistic about assuming
>> that the comparison value is one of the big two.

> Is there any value (or can value be added) in creating a partial index of
> the form:

> archetype IN ('banner','some other rare value')

> such that the planner will see that such a value is possible but infrequent
> and will, in the presence of a plan using a value contained in the partial
> index, refuse to use a generic plan knowing that it will be unable to use
> the very specific index that the user created?

The existence of such an index wouldn't alter the planner's statistics.
In theory we could make it do so, but I seriously doubt the cost-benefit
ratio is attractive, either as to implementation effort or the added
planning cost.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: EXPLAIN ANALYZE output weird for Top-N Sort
Next
From: Tom Lane
Date:
Subject: Re: EXPLAIN ANALYZE output weird for Top-N Sort