Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBrVp-000089-E1 for pgsql-bugs@arkaria.postgresql.org; Tue, 29 Nov 2016 23:08:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cBrVo-0006oo-PD for pgsql-bugs@arkaria.postgresql.org; Tue, 29 Nov 2016 23:08:32 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cBrV9-00065H-S0 for pgsql-bugs@postgresql.org; Tue, 29 Nov 2016 23:07:52 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cBrV7-0004Ed-98 for pgsql-bugs@postgresql.org; Tue, 29 Nov 2016 23:07:50 +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 uATN7jCp011936; Tue, 29 Nov 2016 18:07:45 -0500 From: Tom Lane To: nikolay.nikitin@infowatch.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14438: Wrong row count in the join plan with unique index scan In-reply-to: <20161128182113.6527.58926@wrigleys.postgresql.org> References: <20161128182113.6527.58926@wrigleys.postgresql.org> Comments: In-reply-to nikolay.nikitin@infowatch.com message dated "Mon, 28 Nov 2016 18:21:13 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11934.1480460865.1@sss.pgh.pa.us> Date: Tue, 29 Nov 2016 18:07:45 -0500 Message-ID: <11935.1480460865@sss.pgh.pa.us> X-Pg-Spam-Score: -4.8 (----) 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 nikolay.nikitin@infowatch.com writes: > I execute select with "in" condition on the empty table. > This select works with wrong plan. > I think the wrong plan is chosen becose the postgres optimizer incorrectly > calculates row count in the right plan. I've pushed a patch that should improve matters for such cases. Thanks for the report! 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