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 1sgl4c-007IHD-Of for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Aug 2024 13:08:27 +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 1sgl4a-00Au9m-Kd for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Aug 2024 13:08:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sgl4a-00Au9X-5Z for pgsql-hackers@lists.postgresql.org; Wed, 21 Aug 2024 13:08:24 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sgl4W-000jTA-Np for pgsql-hackers@postgresql.org; Wed, 21 Aug 2024 13:08:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1724245696; bh=NLy9aH/qlgPMNb2xr3z5SW9ZXcFmcUhgOcc7XIvpfRk=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=s76qN9EGcUs4ERqPFV7w+EGmtL16fe1UlFMZot8KRgnl28F5HjPBAC7ABmSZuGE83 c+qzSH5ohF5Lxs0MFxi318OH9OmuFXO9qEdqHHLGTLaSWAB5IICrF3SYHaqogohQ2e FBvCoYSrNzrWPgqzTk7V+2o+RZp0pcmA5/d0vyA/KxKS2xm+1sIrMXuePJSX2FFhlZ pVSrOBin43mh+4PWq8lVyi0rqtHQR7yIjmUiRl1dV8n98VJv98dn/G0gPdeunM15/c ORxhJ7NRja6Hj/1Rr19JWufLp+r16UL7zxiVjAAAI7hKuKdSDYgZi1ZWQLBt5DJvKv xD8I7ABZENbeA== Received: from [172.30.33.218] (unknown [172.30.33.218]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: a.lepikhov@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id C8D7660144; Wed, 21 Aug 2024 16:08:15 +0300 (MSK) Message-ID: <65bfdcb6-0f0c-4d4c-a721-cb38a0ba91c7@postgrespro.ru> Date: Wed, 21 Aug 2024 15:08:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: POC, WIP: OR-clause support for indexes To: Alexander Korotkov , Alena Rybakina Cc: Nikolay Shaplov , pgsql-hackers@lists.postgresql.org, jian he , Robert Haas , pgsql-hackers@postgresql.org, Peter Geoghegan , Marcos Pegoraro , teodor@sigaev.ru, Tomas Vondra , Peter Eisentraut , Ranier Vilela References: <567ED6CA.2040504@sigaev.ru> <8969055.VV5PYv0bhD@thinkpad-pgpro> <38289f6c-b8c0-4713-8fb5-703fe771872a@postgrespro.ru> <759292d5-cb51-4b12-89fa-576c1d9b374d@postgrespro.ru> <531fc0ab-371e-4235-97e3-dd2d077b6995@postgrespro.ru> Content-Language: en-US From: Andrei Lepikhov Organization: Postgres Professional In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-KSMG-AntiPhishing: NotDetected X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.0.7854, bases: 2024/08/21 09:20:00 #26389512 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 21/8/2024 02:17, Alexander Korotkov wrote: > Also, I convert the check you've introduced in the previous message to > op_in_opfamily(), and introduced collation check similar to > match_opclause_to_indexcol(). Hi, I passed through the patches with fresh sight. Conceptually, this approach looks much better than the previous series. Just for the record: previously, we attempted to resolve two issues in one - improve the execution plan and save cycles during the optimisation. As I see it, it is almost impossible in this feature. So, I should come to terms with carrying long OR lists through the planning and the additional overhead this feature generates. I also see that the optimiser has obtained additional planning strategies with these patches and hasn't lost any. Couple of findings: First: /* Only operator clauses scan match */ Should it be: /* Only operator clauses can match */ ? The second one: When creating IndexClause, we assign the original and derived clauses to the new, containing transformed array. But logically, we should set the clause with a list of ORs as the original. Why did you do so? -- regards, Andrei Lepikhov Postgres Professional