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 1gaBX1-0003S6-FD for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Dec 2018 03:31:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gaBWz-0002sI-Mb for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Dec 2018 03:31:21 +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 1gaBWz-0002p7-EB for pgsql-hackers@lists.postgresql.org; Fri, 21 Dec 2018 03:31:21 +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 1gaBWx-0003Ub-EI for pgsql-hackers@lists.postgresql.org; Fri, 21 Dec 2018 03:31:21 +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 wBL3VGQt020221; Thu, 20 Dec 2018 22:31:16 -0500 From: Tom Lane To: Edmund Horner cc: David Rowley , Tomas Vondra , PostgreSQL Developers Subject: Re: Tid scan improvements In-reply-to: References: <8469.1545344467@sss.pgh.pa.us> Comments: In-reply-to Edmund Horner message dated "Fri, 21 Dec 2018 16:19:35 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20219.1545363076.1@sss.pgh.pa.us> Date: Thu, 20 Dec 2018 22:31:16 -0500 Message-ID: <20220.1545363076@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Edmund Horner writes: > For the forward scan, I seem to recall, from your merge join example, > that it's useful to set the pathkeys even when there are no > query_pathkeys. We just have to unconditionally set them so that the > larger plan can make use of them. No. Look at indxpath.c: it does not worry about pathkeys unless has_useful_pathkeys is true, and it definitely does not generate pathkeys that don't get past truncate_useless_pathkeys. Those functions are responsible for worrying about whether mergejoin can use the pathkeys. It's not tidpath.c's job to outthink them. regards, tom lane