Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qI1A9-0007eU-GB for pgsql-hackers@arkaria.postgresql.org; Sat, 08 Jul 2023 06:11:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qI1A6-0006nN-Lh for pgsql-hackers@arkaria.postgresql.org; Sat, 08 Jul 2023 06:11:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qI1A6-0006mV-6p for pgsql-hackers@lists.postgresql.org; Sat, 08 Jul 2023 06:11:18 +0000 Received: from mailrelay3-2.pub.mailoutpod2-cph3.one.com ([2a02:2350:5:408::1]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qI19z-002rcv-AO for pgsql-hackers@lists.postgresql.org; Sat, 08 Jul 2023 06:11:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kimmet.dk; s=rsa1; h=content-transfer-encoding:content-type:in-reply-to:from:references:to:subject: mime-version:date:message-id:from; bh=hhzNO/5GzlSuuAZ2Cy16HhesrNKQkhTv93+8uBSLhWo=; b=KjHul1dDdxDWxucaeL1ntycqzHnMZkrwv8+GUiIhuPh4imSvMJpTMtybbhkrZGMhTnx4p0e1fN0Y5 bFp276mnK2y5AeDPYaQ6DTSS7SxZSnSE66ePNBq4WpdtKlw01MoX1f5YKCaJ2NSfbbnub0JqDue3ez Q0iazcSEu4wT31tl6zXnmZ2jBl3CSS+X+OqK0WFHpR9m6maZbRQ+nLxclcVEFpmM8CoYIgmS16/dQ1 QUEykm7trYZOkTMdKoEGuE9PsVZ2ZlJhrmfdY5EGBuQTquv1RCQkZS+7CnxHF4DQbIfGyCQlprrsUJ GGdMacNMzaXuXkJsek6wWeI6JzrwTDw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=kimmet.dk; s=ed1; h=content-transfer-encoding:content-type:in-reply-to:from:references:to:subject: mime-version:date:message-id:from; bh=hhzNO/5GzlSuuAZ2Cy16HhesrNKQkhTv93+8uBSLhWo=; b=UEKcJkhDLZXkFRw5mQW4B8GgudVSMaTR/nz4T/iIeXhv0GkcZUVi9EFuMxgfK5ImeIrpEddFvjCIT 6l9FjM4BQ== X-HalOne-ID: 39f02179-1d56-11ee-81fa-b90637070a9d Received: from [192.168.1.145] (unknown [5.186.126.43]) by mailrelay3 (Halon) with ESMTPSA id 39f02179-1d56-11ee-81fa-b90637070a9d; Sat, 08 Jul 2023 06:11:08 +0000 (UTC) Message-ID: <4cdc292e-3234-a03d-107d-31cf8b721cd4@kimmet.dk> Date: Sat, 8 Jul 2023 08:11:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] Add support function for containment operators To: pgsql-hackers@lists.postgresql.org References: <94f64d1f-b8c0-b0c5-98bc-0793a34e0851@kimmet.dk> <4e6efd382b3195eb7ea438b7219cc94d9399c0bd.camel@cybertec.at> <147ac793f2c3a9a57764fba84988a4b5e843443b.camel@cybertec.at> Content-Language: da From: Kim Johan Andersson In-Reply-To: <147ac793f2c3a9a57764fba84988a4b5e843443b.camel@cybertec.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 07-07-2023 13:20, Laurenz Albe wrote: > I wrote: >> You implement both "SupportRequestIndexCondition" and "SupportRequestSimplify", >> but when I experimented, the former was never called.  That does not >> surprise me, since any expression of the shape "expr <@ range constant" >> can be simplified.  Is the "SupportRequestIndexCondition" branch dead code? >> If not, do you have an example that triggers it? I would think it is dead code, I came to the same conclusion. So we can drop SupportRequestIndexCondition, since the simplification happens to take care of everything. > I had an idea about this: > So far, you only consider constant ranges. But if we have a STABLE range > expression, you could use an index scan for "expr <@ range", for example > Index Cond (expr >= lower(range) AND expr < upper(range)). > I will try to look into this. Originally that was what I was hoping for, but didn't see way of going about it. Thanks for your comments, I will also look at the locale-related breakage you spotted. Regards, Kimjand