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 1rcGfR-001sa6-1L for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Feb 2024 03:19:37 +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 1rcGeR-000dW9-EL for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Feb 2024 03:18:35 +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 1rcGeR-000dW1-0f for pgsql-hackers@lists.postgresql.org; Tue, 20 Feb 2024 03:18:35 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcGeN-007cXS-83 for pgsql-hackers@postgresql.org; Tue, 20 Feb 2024 03:18:33 +0000 Received: from [172.30.0.166] (unknown [172.30.0.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: a.lepikhov@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id D0B48E20D15; Tue, 20 Feb 2024 06:18:25 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1708399108; bh=nMK6JAz9Wlp3+vdD6gPtmbMC9kE/u4IMSemCUD22Pvo=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=213v7E2yrRRB9vZvwJzVPrKIRKrj2VttBE3yllCUNa/Ovj3j9TrC4LosCcLt6iXwK XcJluxaL6Bh+aWw/uxq8Dudqi8ojiaRqAQnGGnTqPepdwxrbFCcday02Ou6HLz+ips QyJRuH2Ozs8C4T/KIsbNEXUwEnD8oLZzMtIkRdBm490pyJY0v/EJg4dhFrQG0VVazA 7nSoHNiMsy+wju0Uj6PF4aJjG/REEUHLPoDbp1zDqMG08g7FfTxqmmu9Njop52S1FH 1ZYdJnyIPtLMJX8V3OchCJdpZjQHg8R6UJtzEIiRpXoraYKVCwVdlhPC5m9m8PDJP6 A6tBjTNDIQnDQ== Content-Type: multipart/mixed; boundary="------------80ezoVsMW7ZQUOXteSYzTZVx" Message-ID: <21088129-7cd3-424a-bcce-6a3427ba3276@postgrespro.ru> Date: Tue, 20 Feb 2024 10:18:23 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: POC, WIP: OR-clause support for indexes Content-Language: en-US To: Ranier Vilela Cc: jian he , Alena Rybakina , Alexander Korotkov , Robert Haas , pgsql-hackers@postgresql.org, Peter Geoghegan , "Finnerty, Jim" , Marcos Pegoraro , teodor@sigaev.ru, Tomas Vondra , Peter Eisentraut References: <567ED6CA.2040504@sigaev.ru> <7e11e27b-7ab9-4d59-af0a-a921861a9206@postgrespro.ru> <13ad923a-33df-4b44-9e00-c9323cd4c37d@postgrespro.ru> <1cf6b382-6e27-4268-9f2a-54ada66eb2eb@postgrespro.ru> <5f119769-ab11-4807-abcc-71d5dd914ea0@postgrespro.ru> From: Andrei Lepikhov Organization: Postgres Professional In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------80ezoVsMW7ZQUOXteSYzTZVx Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 19/2/2024 19:53, Ranier Vilela wrote: > v17-0002 > 1) move the vars *arrayconst and *dest, to after if, to avoid makeNode > (palloc). > + Const   *arrayconst; > + ScalarArrayOpExpr  *dest; > + > + pd = (PredicatesData *) lfirst(lc); > + if (pd->elems == NIL) > + /* The index doesn't participate in this operation */ > + continue; > > + arrayconst = lsecond_node(Const, saop->args); > + dest = makeNode(ScalarArrayOpExpr); Thanks for the review! I'm not sure I understand you clearly. Does the patch in attachment fix the issue you raised? -- regards, Andrei Lepikhov Postgres Professional --------------80ezoVsMW7ZQUOXteSYzTZVx Content-Type: text/plain; charset=UTF-8; name="fix.diff" Content-Disposition: attachment; filename="fix.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9iYWNrZW5kL29wdGltaXplci9wYXRoL2luZHhwYXRoLmMgYi9z cmMvYmFja2VuZC9vcHRpbWl6ZXIvcGF0aC9pbmR4cGF0aC5jCmluZGV4IDU2YjA0NTQxZGIu LjE1NDU4NzZlMmYgMTAwNjQ0Ci0tLSBhL3NyYy9iYWNrZW5kL29wdGltaXplci9wYXRoL2lu ZHhwYXRoLmMKKysrIGIvc3JjL2JhY2tlbmQvb3B0aW1pemVyL3BhdGgvaW5keHBhdGguYwpA QCAtMTI4NCw3ICsxMjg0LDcgQEAgYnVpbGRfcGF0aHNfZm9yX1NBT1AoUGxhbm5lckluZm8g KnJvb3QsIFJlbE9wdEluZm8gKnJlbCwgUmVzdHJpY3RJbmZvICpyaW5mbywKIAkJQXJyYXlU eXBlCQkgICAqYXJyYXl2YWwgPSBOVUxMOwogCQlBcnJheUV4cHIJCSAgICphcnIgPSBOVUxM OwogCQlDb25zdAkJCSAgICphcnJheWNvbnN0ID0gbHNlY29uZF9ub2RlKENvbnN0LCBzYW9w LT5hcmdzKTsKLQkJU2NhbGFyQXJyYXlPcEV4cHIgICpkZXN0ID0gbWFrZU5vZGUoU2NhbGFy QXJyYXlPcEV4cHIpOworCQlTY2FsYXJBcnJheU9wRXhwcglkZXN0OwogCiAJCXBkID0gKFBy ZWRpY2F0ZXNEYXRhICopIGxmaXJzdChsYyk7CiAJCWlmIChwZC0+ZWxlbXMgPT0gTklMKQpA QCAtMTMwMiwxMCArMTMwMiwxMCBAQCBidWlsZF9wYXRoc19mb3JfU0F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