Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vi8nt-0003lx-CD for pgsql-bugs@arkaria.postgresql.org; Sun, 17 Nov 2013 20:18:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Vi8ns-00079t-Rt for pgsql-bugs@arkaria.postgresql.org; Sun, 17 Nov 2013 20:18:44 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vi8nr-00079m-QN for pgsql-bugs@postgresql.org; Sun, 17 Nov 2013 20:18:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vi8np-0008O8-5a for pgsql-bugs@postgresql.org; Sun, 17 Nov 2013 20:18:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id rAHKIdkl016494; Sun, 17 Nov 2013 15:18:39 -0500 From: Tom Lane To: Marko Tiikkaja cc: pgsql-bugs@postgresql.org Subject: Re: BUG #8598: Row count estimates of partial indexes In-reply-to: <52891F32.8010902@joh.to> References: <28474.1384705755@sss.pgh.pa.us> <52891F32.8010902@joh.to> Comments: In-reply-to Marko Tiikkaja message dated "Sun, 17 Nov 2013 20:55:30 +0100" Date: Sun, 17 Nov 2013 15:18:39 -0500 Message-ID: <16493.1384719519@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) 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 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? 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. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs