Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ViLhh-00077v-Af for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Nov 2013 10:05:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1ViLhg-0005JI-MH for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Nov 2013 10:05:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ViLhf-0005I4-Ho for pgsql-bugs@postgresql.org; Mon, 18 Nov 2013 10:05:11 +0000 Received: from mail-lb0-f177.google.com ([209.85.217.177]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ViLhc-0002Hv-Ow for pgsql-bugs@postgresql.org; Mon, 18 Nov 2013 10:05:11 +0000 Received: by mail-lb0-f177.google.com with SMTP id w7so871035lbi.22 for ; Mon, 18 Nov 2013 02:05:07 -0800 (PST) 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=ntNYdEY4fpQJjFdAiSSgFSs5/mQTkxV+1DBPgp+F6Hs=; b=Ty3wy2d+j7ZzN3krS5g2ussBEGqwlN+9c4dERnd3SeicKonwCUc/fSO7q7NeixcLwy BZiJhIRAVr8DA91evp6/wavj1YPNyZ4cGzdrhm67WDeLZegF47h4MMBpeSuhjsWuvn4p ty8twUC/jIGpPh5a4FrcOqYVuVMVxZO+i2Jy68/oXVuCU6hX8+KsA/NGEvnDGJyy8FZ8 EFzpo/9oK1XP6TYeRPF6KmovoHnJi7zZRTRem7HhScPdgvEOCoCDlOcKEZAIufFn71M1 U3FAo/kvRQiaKqsGeyS7yyKuBq3jXgCaaXZ+r58gPLMqa64aAlDsRnhvvWedlhGtjvKo /lQA== X-Gm-Message-State: ALoCoQnGzKzcz+ndyBdFCftGMllIABguqw+0zUaHuAcJFtrE3gkjNPPf7eIDiQUuNsNvM3Sbzdxh X-Received: by 10.112.172.137 with SMTP id bc9mr13104054lbc.21.1384769107670; Mon, 18 Nov 2013 02:05:07 -0800 (PST) Received: from Markos-MacBook-Pro.local ([46.246.117.202]) by mx.google.com with ESMTPSA id e10sm16707431laa.6.2013.11.18.02.05.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Nov 2013 02:05:06 -0800 (PST) Message-ID: <5289E650.5070802@joh.to> Date: Mon, 18 Nov 2013 11:05:04 +0100 From: Marko Tiikkaja User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Tom Lane CC: pgsql-bugs@postgresql.org Subject: Re: BUG #8598: Row count estimates of partial indexes References: <28474.1384705755@sss.pgh.pa.us> <52891F32.8010902@joh.to> <16493.1384719519@sss.pgh.pa.us> In-Reply-To: <16493.1384719519@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; 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-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 11/17/13 9:18 PM, Tom Lane wrote: > Marko Tiikkaja writes: >> Any suggestions for a workaround? When reading this index as a part of >> a bigger query the horrible estimate ensures that nobody's having fun. > > Why is the estimate so bad? I suppose the answer is that those two > columns are very strongly correlated. Maybe you could refactor your > data representation to avoid that? I'll look into that, thanks. > The long-term answer as far as Postgres is concerned is to learn about > cross-column correlations, but that's not happening in the near future. I'm completely clueless about how the planner works, but wouldn't it be easier to have some kind of separate stats for the conditions in partial indexes? It seems better in all cases than trying infer the stats from cross-column correlations, even if we had that. Regards, Marko Tiikkaja -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs