Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iAnv0-0002bD-1N for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Sep 2019 04:19:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iAnuy-0007pf-LZ for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Sep 2019 04:19:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iAnuy-0007pW-7S for pgsql-bugs@lists.postgresql.org; Thu, 19 Sep 2019 04:19:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iAnur-0001Ew-Dy for pgsql-bugs@postgresql.org; Thu, 19 Sep 2019 04:19:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x8J4JYo7029404; Thu, 19 Sep 2019 00:19:34 -0400 From: Tom Lane To: Morris de Oryx cc: pgsql-bugs@postgresql.org Subject: Re: citext LIKE search bug In-reply-to: References: Comments: In-reply-to Morris de Oryx message dated "Thu, 19 Sep 2019 10:32:08 +1000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29402.1568866774.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 19 Sep 2019 00:19:34 -0400 Message-ID: <29403.1568866774@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Morris de Oryx writes: > I'm using citext fields, and am working through how to build indexes tha= t > the planner recognizes. I found this paragraph in the PG 11 release note= s: > "Allow creation of indexes that can be used by LIKE comparisons on citex= t > columns (Alexey Chernyshov) > To do this, the index must be created using the citext_pattern_ops opera= tor > class." > https://www.postgresql.org/docs/11/release-11.html > As far as I can tell, this doesn't work, or at least not in my case with= an > expression index. Hm. I found the original submission in the archives [1], and Alexey explicitly *didn't* claim that that patch was sufficient to enable LIKE index optimizations on citext. Indeed it obviously isn't, since it just created some weirdly-named operators without connecting them up to the LIKE plumbing in any way. So this seems like a case of the REL11 release notes author (probably Bruce) not reading too closely, which doesn't seem like entirely his fault since the commit message was totally content-free about what the point of the patch was [2]. But anyway, right now it seems to me that citext_pattern_ops has exactly zero value, which makes me wonder why we committed it in advance of some use-case getting filled in. It's not such a large patch that it had to get in to reduce its maintenanc= e overhead. While I'm looking at it, I notice that the patch failed to honor the scalarltsel-vs-scalarlesel, scalargtsel-vs-scalargesel distinction that had been created not too long before. Sigh. Anyway it seems like the only near-term to-do item here is to correct the v11 release notes to not claim that citext_pattern_ops does anything useful. Maybe we should just remove the entry altogether. regards, tom lane [1] https://www.postgresql.org/message-id/flat/d868ae6c-501c-a17c-c01b-f53= 1d646172d%40postgrespro.ru [2] https://git.postgresql.org/gitweb/?p=3Dpostgresql.git&a=3Dcommitdiff&h= =3Df24649976