Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YwFCx-0003o4-IR for pgsql-hackers@arkaria.postgresql.org; Sat, 23 May 2015 19:35:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YwFCw-00072W-SF for pgsql-hackers@arkaria.postgresql.org; Sat, 23 May 2015 19:35:42 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YwFCv-00072P-B4 for pgsql-hackers@postgresql.org; Sat, 23 May 2015 19:35:41 +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) (envelope-from ) id 1YwFCn-0000rP-Vd for pgsql-hackers@postgresql.org; Sat, 23 May 2015 19:35:40 +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 t4NJZLQR031466; Sat, 23 May 2015 15:35:22 -0400 From: Tom Lane To: Heikki Linnakangas cc: pgsql-hackers@postgresql.org Subject: Re: [COMMITTERS] pgsql: Allow GiST distance function to return merely a lower-bound. In-reply-to: References: Comments: In-reply-to Heikki Linnakangas message dated "Fri, 15 May 2015 11:27:13 -0000" Date: Sat, 23 May 2015 15:35:21 -0400 Message-ID: <31465.1432409721@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) 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 Heikki Linnakangas writes: > Allow GiST distance function to return merely a lower-bound. I wondered how come this patch did not touch nodeIndexonlyscan.c. After some investigation, it seems the only reason that this patch even appears to work is that none of the built-in or contrib opclasses support both lossy ordering operators and GIST fetch functions. Otherwise we would do an index-only scan and the executor would simply ignore the recheck flag. I doubt we can ship this in this state; even if the core code doesn't exercise the problematic combination, surely third-party opclasses will want to? I thought about hacking the planner to not select index-only scans, but there's no way for it to know whether the opclass might return recheck = true at runtime. I think the only real fix is to actually propagate all the changes in nodeIndexscan.c into nodeIndexonlyscan.c. Testing it would be problematic without a suitable opclass, though :-( A short-term hack might be to throw a "not implemented" error in nodeIndexonlyscan.c if it sees the distance-recheck flag set. 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