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 1qQenP-000aEv-6T for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Aug 2023 02:07:36 +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 1qQenN-002y1S-0B for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Aug 2023 02:07:34 +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 1qQenM-002y1J-Ii for pgsql-hackers@lists.postgresql.org; Tue, 01 Aug 2023 02:07:34 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qQenH-0005zn-0S for pgsql-hackers@lists.postgresql.org; Tue, 01 Aug 2023 02:07:32 +0000 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3177163aa97so5358248f8f.0 for ; Mon, 31 Jul 2023 19:07:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20221208.gappssmtp.com; s=20221208; t=1690855645; x=1691460445; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=kFB8Vq9uDWJBCAQFkTPERMV8LJtN7FsFkSagiVOB3xk=; b=BGBvgSyou7tlgNmLitFPhOAl8nOgmQ+9KJ45oYfRRCikMgShhN13GSYFhzwayNkrGZ bu0ahG+kXCqqKOxL757k5TaAlYQd8Zw1W9THvql5o7wWRcjFx12kzmk60KDOHOkbXS7c 6Q2RRor5+LBCF8ybNsKlTSEnwyJbam+TA7d3VnMl989SGmmjK9gXEuDYPo+y1vtVBOKj lsIDbN2gJHfQqITBdiWWwXIuC3+JBSGXoY1UNCrclMcYA9MdHAQ1DYpt1iokokR3qBtN sUXRY+ABFhuNqimsnLQuOQCSRZoxEnL8znmykpIUyK9iai5cfURFqv+qN1f5ZQ5Na3bA 52FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690855645; x=1691460445; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=kFB8Vq9uDWJBCAQFkTPERMV8LJtN7FsFkSagiVOB3xk=; b=RC76ezSW6iI1m1h452TW7ZoTwvFQKn7hYFS9rEGOcW6SmNOhC6rVZNtXy9MnalHzzN 8gYZgGzR4d2iqHH1J9BaSM5vt03dY1O5VCBUFPsiMG46+q4360iPvm7XWRRqLlil2/KA p8c798oDrd48h11MIf31EI40axNf9Odyu8RLaWqqOjZZsLmTkNYhet/opHjDd7jR7u3D lts8thbd60p7toB5xdabo5wCNTmi8HliUQ3ESZtFS4M7cN6w+JMLbM3AUJVI4LQHymfq CaFOIpfTVpDoci3Q0LnC9thiXJv3jhRkPAQ0ob/9K8BfF1y6nlc4wq6CtHxwj+BnJGDk HafQ== X-Gm-Message-State: ABy/qLYai1mQNiiR/+iU0apLqSJySJgi2NtI85WznWwgzkCnFMFRukVf JrFjnzEA+zFAzuII2W2YK9sip0xSrXVxhNDvpso= X-Google-Smtp-Source: APBJJlHDGRq2+Ud3Y82vL50b63E+Xs7ytH93x7s/z+M0oIBU9SphNXFbSP51mkcKCYymWcVC3jAEFQ== X-Received: by 2002:a5d:62c7:0:b0:315:ad00:e628 with SMTP id o7-20020a5d62c7000000b00315ad00e628mr971054wrv.47.1690855645106; Mon, 31 Jul 2023 19:07:25 -0700 (PDT) Received: from localhost.localdomain (62-46-254-25.adsl.highway.telekom.at. [62.46.254.25]) by smtp.gmail.com with ESMTPSA id k14-20020adfe3ce000000b00317643a93f4sm14585312wrm.96.2023.07.31.19.07.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 19:07:24 -0700 (PDT) Message-ID: <36ea800b7b537c89d92bcd109b3858c72c16a14c.camel@cybertec.at> Subject: Re: [PATCH] Add support function for containment operators From: Laurenz Albe To: Kim Johan Andersson , pgsql-hackers@lists.postgresql.org Date: Tue, 01 Aug 2023 04:07:24 +0200 In-Reply-To: <4cdc292e-3234-a03d-107d-31cf8b721cd4@kimmet.dk> References: <94f64d1f-b8c0-b0c5-98bc-0793a34e0851@kimmet.dk> <4e6efd382b3195eb7ea438b7219cc94d9399c0bd.camel@cybertec.at> <147ac793f2c3a9a57764fba84988a4b5e843443b.camel@cybertec.at> <4cdc292e-3234-a03d-107d-31cf8b721cd4@kimmet.dk> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, 2023-07-08 at 08:11 +0200, Kim Johan Andersson wrote: > On 07-07-2023 13:20, Laurenz Albe wrote: > > I wrote: > > > You implement both "SupportRequestIndexCondition" and "SupportRequest= Simplify", > > > but when I experimented, the former was never called.=C2=A0 That does= not > > > surprise me, since any expression of the shape "expr <@ range constan= t" > > > can be simplified.=C2=A0 Is the "SupportRequestIndexCondition" branch= dead code? > > > If not, do you have an example that triggers it? >=20 > I would think it is dead code, I came to the same conclusion. So we can= =20 > drop SupportRequestIndexCondition, since the simplification happens to= =20 > take care of everything. >=20 >=20 > > I had an idea about this: > > So far, you only consider constant ranges.=C2=A0 But if we have a STABL= E range > > expression, you could use an index scan for "expr <@ range", for exampl= e > > Index Cond (expr >=3D lower(range) AND expr < upper(range)). > >=20 >=20 > I will try to look into this. Originally that was what I was hoping for,= =20 > but didn't see way of going about it. >=20 > Thanks for your comments, I will also look at the locale-related=20 > breakage you spotted. I have marked the patch as "returned with feedback". I encourage you to submit an improved version in a future commitfest! Yours, Laurenz Albe