Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBlFD-0005tW-Bl for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Apr 2019 19:08:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hBlFB-0008UC-Tj for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Apr 2019 19:08:17 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBlFB-0008Td-KO for pgsql-hackers@lists.postgresql.org; Wed, 03 Apr 2019 19:08:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBlF9-000122-24 for pgsql-hackers@postgresql.org; Wed, 03 Apr 2019 19:08:17 +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 x33J85Sv032414; Wed, 3 Apr 2019 15:08:05 -0400 From: Tom Lane To: Tomas Vondra cc: Surafel Temesgen , David Steele , Michael Paquier , Robert Haas , andrew@tao11.riddles.org.uk, PostgreSQL Hackers Subject: Re: FETCH FIRST clause WITH TIES option In-reply-to: <20190403190257.44fxttkpo4yopp3l@development> References: <20190204052857.GP29064@paquier.xyz> <20190329005648.GA1136@development> <20190331001446.GA10804@development> <20190403190257.44fxttkpo4yopp3l@development> Comments: In-reply-to Tomas Vondra message dated "Wed, 03 Apr 2019 21:02:57 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32412.1554318485.1@sss.pgh.pa.us> Date: Wed, 03 Apr 2019 15:08:05 -0400 Message-ID: <32413.1554318485@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tomas Vondra writes: > I've tried to fix the merge conflict (essentially by moving some of the > code to adjust_limit_rows_costs(), but I'm wondering if the code added to > create_limit_path is actually correct > ... > Firstly, this seriously needs some comment explaining why we do this. I've not looked at this patch, but TBH I wonder why it is touching planner rowcount estimation at all. I find it doubtful either that a correction for WITH TIES would be significant in most use-cases, or that we could estimate it accurately if it was significant. It certainly doesn't seem like something that needs to be messed with in v1 of the feature. regards, tom lane