Re: PATCH: adaptive ndistinct estimator v4

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: hlinnaka <hlinnaka(at)iki(dot)fi>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PATCH: adaptive ndistinct estimator v4
Date: 2015-04-30 22:18:43
Message-ID: CA+TgmoYzriVcAefToJNhwJoJH-c1na71YveLvwC637q2RL1wUA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

On Thu, Apr 30, 2015 at 5:31 PM, Heikki Linnakangas <hlinnaka(at)iki(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-04-30 22:20:44 Re: initdb -S and tablespaces
Previous Message Alvaro Herrera 2015-04-30 22:18:08 Re: initdb -S and tablespaces

Browse pgsql-performance by date

  From Date Subject
Next Message Tomas Vondra 2015-05-01 01:20:15 Re: PATCH: adaptive ndistinct estimator v4
Previous Message Heikki Linnakangas 2015-04-30 21:31:48 Re: PATCH: adaptive ndistinct estimator v4