Re: PATCH: adaptive ndistinct estimator v4 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: PATCH: adaptive ndistinct estimator v4
Date
Msg-id CA+TgmoYzriVcAefToJNhwJoJH-c1na71YveLvwC637q2RL1wUA@mail.gmail.com
Whole thread Raw
In response to Re: PATCH: adaptive ndistinct estimator v4  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: PATCH: adaptive ndistinct estimator v4  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List pgsql-hackers
On Thu, Apr 30, 2015 at 5:31 PM, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
> On 04/30/2015 01:57 PM, Robert Haas wrote:
>> 2. There should be a compatibility GUC to restore the old behavior.
>> The new behavior should be the default, because if we're not confident
>> that the new behavior will be better for most people, we have no
>> business installing it in the first place (plus few people will try
>> it).  But just in case it turns out to suck for some people, we should
>> provide an escape hatch, at least for a few releases.
>
> You can override the ndistinct estimate with ALTER TABLE. I think that's
> enough for an escape hatch.

I'm not saying that isn't nice to have, but I don't think it really
helps much here.  Setting the value manually requires that you know
what value to set, and you might not.  If, on some workloads, the old
algorithm beats the new one reliably, you want to be able to actually
go back to the old algorithm, not manually override every wrong
decision it makes.  A GUC for this is pretty cheap insurance.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: initdb -S and tablespaces
Next
From: Robert Haas
Date:
Subject: Re: initdb -S and tablespaces