Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ru4SR-002By0-PZ for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Apr 2024 05:55:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ru4SQ-000JCI-VF for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Apr 2024 05:55:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ru4SQ-000JC9-Ld for pgsql-hackers@lists.postgresql.org; Tue, 09 Apr 2024 05:55:46 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ru4SN-001hEV-Vu for pgsql-hackers@postgresql.org; Tue, 09 Apr 2024 05:55:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4395tdWA3649288; Tue, 9 Apr 2024 01:55:39 -0400 From: Tom Lane To: Andrei Lepikhov cc: Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: post-freeze damage control In-reply-to: <38494264-62c1-4b37-be16-84197018e8f7@postgrespro.ru> References: <3604469.1712628736@sss.pgh.pa.us> <38494264-62c1-4b37-be16-84197018e8f7@postgrespro.ru> Comments: In-reply-to Andrei Lepikhov message dated "Tue, 09 Apr 2024 12:37:31 +0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3649286.1712642139.1@sss.pgh.pa.us> Date: Tue, 09 Apr 2024 01:55:39 -0400 Message-ID: <3649287.1712642139@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andrei Lepikhov writes: > On 9/4/2024 09:12, Tom Lane wrote: >> I have another one that I'm not terribly happy about: >> Author: Alexander Korotkov >> Branch: master [72bd38cc9] 2024-04-08 01:27:52 +0300 >> Transform OR clauses to ANY expression >> * What the medical community would call off-label usage of >> query jumbling. I'm not sure this is even correct as-used, >> and for sure it's using that code for something never intended. >> Nor is the added code adequately (as in, at all) documented. > I agree with documentation and disagree with critics on the expression > jumbling. It was introduced in the core. Why don't we allow it to be > used to speed up machinery with some hashing? I would back up from that a good deal: why do we need to hash here in the first place? There's no evidence I'm aware of that it's needful from a performance standpoint. >> * I really, really dislike jamming this logic into prepqual.c, >> where it has no business being. I note that it was shoved >> into process_duplicate_ors without even the courtesy of >> expanding the header comment: > Yeah, I preferred to do it in parse_expr.c with the assumption of some > 'minimal' or 'canonical' tree form. That seems quite the wrong direction to me. AFAICS, the argument for making this transformation depends on being able to convert to an indexscan condition, so I would try to apply it even later, when we have a set of restriction conditions to apply to a particular baserel. (This would weaken the argument that we need hashing rather than naive equal() tests even further, I think.) Applying the transform to join quals seems unlikely to be a win. regards, tom lane