Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Uce0I-0003a5-RK for pgsql-performance@arkaria.postgresql.org; Wed, 15 May 2013 15:52:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Uce0I-0005ow-BF for pgsql-performance@arkaria.postgresql.org; Wed, 15 May 2013 15:52:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Uce0G-0005ng-CD for pgsql-performance@postgresql.org; Wed, 15 May 2013 15:52:32 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Uce0C-0007os-Ct for pgsql-performance@postgresql.org; Wed, 15 May 2013 15:52:32 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id CE70C2856C; Wed, 15 May 2013 08:52:25 -0700 (PDT) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id CB25618793; Wed, 15 May 2013 08:52:25 -0700 (PDT) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id 74105120035; Wed, 15 May 2013 08:57:38 -0700 (PDT) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA; Wed, 15 May 2013 08:57:37 -0700 (PDT) Message-ID: <5193AF36.3040409@vmware.com> Date: Wed, 15 May 2013 18:52:22 +0300 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: sthomas@optionshouse.com CC: "pgsql-performance@postgresql.org" Subject: Re: Thinking About Correlated Columns (again) References: <5193AA62.2040700@optionshouse.com> In-Reply-To: <5193AA62.2040700@optionshouse.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -7.5 (-------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 15.05.2013 18:31, Shaun Thomas wrote: > I've seen conversations on this since at least 2005. There were even > proposed patches every once in a while, but never any consensus. Anyone > care to comment? Well, as you said, there has never been any consensus. There are basically two pieces to the puzzle: 1. What metric do you use to represent correlation between columns? 2. How do use collect that statistic? Based on the prior discussions, collecting the stats seems to be tricky. It's not clear for which combinations of columns it should be collected (all possible combinations? That explodes quickly...), or how it can be collected without scanning the whole table. I think it would be pretty straightforward to use such a statistic, once we have it. So perhaps we should get started by allowing the DBA to set a correlation metric manually, and use that in the planner. - Heikki -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance