Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ynzgp-0002GE-2n for pgsql-hackers@arkaria.postgresql.org; Fri, 01 May 2015 01:24:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Ynzgn-0008Bn-RJ for pgsql-hackers@arkaria.postgresql.org; Fri, 01 May 2015 01:24:25 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Ynzgm-0008Bd-Ey for pgsql-hackers@postgresql.org; Fri, 01 May 2015 01:24:24 +0000 Received: from mail-wg0-f48.google.com ([74.125.82.48]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Ynzgj-0004WT-0r for pgsql-hackers@postgresql.org; Fri, 01 May 2015 01:24:23 +0000 Received: by wgso17 with SMTP id o17so79842767wgs.1 for ; Thu, 30 Apr 2015 18:24:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=Vr74y5hbKgeJ1NJWlJH+Jtbg/wiilssbD44TuwhLx28=; b=gkccwToD9Frl8FHNarB31Z3RcDM+a2ODEnIs19dyKcPCu3qa3G0zQUi1X6SAOj4lko cbBDuxeEoppQdXwXvG9cPy4b8wPijo9Mt0g5ytoQnF2dk2qaYfUPwt6e2yXSdnTOynFb 4eq6KCZ4Q3T9ex7I4zj1fCyZ200RiU0tfI1KnEhZMmR8qFQz1Wb/7okhR2LYxhsPeMrC ASxF8ekxnm1tVVmZhMYiIj99xAazUcqrcN5H0QbV/fhx8ZF5Phoe2XEACJvsBzHTVMVf jWWi6U0PHkkG8kPhc70x1b1iEOoB/avrTygbdTpyON9r/hTnWxZmdsAczUBCuAfxOgP2 kmXw== X-Gm-Message-State: ALoCoQkQA7hkw8Zv8AbnFC2yqmJFS8DF5JsrswBkB7IW5FM3rstIX9MQiJne1ee5VOCY0owl96bbzrqwnyDiTICN0Afj+74E9Dm+8vMK85jFMbNpqj4NYC1iwB4condGQaGNRGWc+DOrzhesHWpu9Ac/qZM0VUTxFiE8dDbGH7dSI59UbihRxj8feLZDoU2kzwj1yIKAi/rb X-Received: by 10.180.107.70 with SMTP id ha6mr10158605wib.20.1430443458622; Thu, 30 Apr 2015 18:24:18 -0700 (PDT) Received: from [10.137.2.12] (ip-78-45-139-138.net.upcbroadband.cz. [78.45.139.138]) by mx.google.com with ESMTPSA id wr2sm5558745wjb.45.2015.04.30.18.24.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Apr 2015 18:24:17 -0700 (PDT) Message-ID: <5542D5BE.4070109@2ndquadrant.com> Date: Fri, 01 May 2015 03:24:14 +0200 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Robert Haas , hlinnaka CC: "pgsql-hackers@postgresql.org" Subject: Re: PATCH: adaptive ndistinct estimator v4 References: <541A2335.3060100@agliodbs.com> <542C4E60.3030505@agliodbs.com> <542DADEB.2080103@agliodbs.com> <54381D20.9010501@fuzzy.cz> <5472416C.3080506@fuzzy.cz> <5483B346.6000203@fuzzy.cz> <551AEF45.7010700@2ndquadrant.com> <55429F44.2070205@iki.fi> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 05/01/15 00:18, Robert Haas wrote: > On Thu, Apr 30, 2015 at 5:31 PM, Heikki Linnakangas wrote: >> >> 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. IMHO this is exactly the same situation as with the current ndistinct estimator. If we find out we'd have to use this workaround more frequently than before, then clearly the new estimator is rubbish and should not be committed. In other words, I agree with Heikki. -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers