Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9ugS-000083-U8 for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Nov 2017 15:12:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e9ugS-0007XJ-2o for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Nov 2017 15:12:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e9ugR-0007X8-J7 for pgsql-hackers@postgresql.org; Wed, 01 Nov 2017 15:11:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e9ugO-00059F-Qm for pgsql-hackers@postgresql.org; Wed, 01 Nov 2017 15:11:59 +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 vA1FBssr009879; Wed, 1 Nov 2017 11:11:54 -0400 From: Tom Lane To: Ashutosh Bapat cc: pgsql-hackers Subject: Re: Account for cost and selectivity of HAVING quals In-reply-to: References: <20968.1509486337@sss.pgh.pa.us> Comments: In-reply-to Ashutosh Bapat message dated "Wed, 01 Nov 2017 18:06:55 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9877.1509549114.1@sss.pgh.pa.us> Date: Wed, 01 Nov 2017 11:11:54 -0400 Message-ID: <9878.1509549114@sss.pgh.pa.us> 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 Ashutosh Bapat writes: > On Wed, Nov 1, 2017 at 3:15 AM, Tom Lane wrote: >> here's a patch to fix the planner so that eval costs and selectivity of >> HAVING quals are factored into the appropriate plan node numbers. >> ... >> + /* Add cost of qual, if any --- but we ignore its selectivity */ > And may be we should try to explain why can we ignore selectivity. > Similarly for the changes in create_minmaxagg_path(). I'm sure you realize that's because the estimate is already just one row ... but sure, we can spell that out. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers