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 1hx74k-00020P-E9 for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Aug 2019 09:57:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hx74j-0000hK-3P for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Aug 2019 09:57:13 +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 1hx74i-0000eC-Kw for pgsql-bugs@lists.postgresql.org; Mon, 12 Aug 2019 09:57:12 +0000 Received: from mout.kundenserver.de ([212.227.126.134]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hx74b-0000F8-Ui for pgsql-bugs@lists.postgresql.org; Mon, 12 Aug 2019 09:57:11 +0000 Received: from oxbsltgw09.schlund.de ([172.19.249.26]) by mrelayeu.kundenserver.de (mreue009 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MVNF1-1hpiOI1phv-00SS2o for ; Mon, 12 Aug 2019 11:57:01 +0200 Date: Mon, 12 Aug 2019 11:57:00 +0200 (CEST) From: James Inform Reply-To: James Inform To: pgsql-bugs@lists.postgresql.org Message-ID: <741027258.89460.1565603820750@email.ionos.de> In-Reply-To: <22763.1565566888@sss.pgh.pa.us> References: <15948-8767af672d99063a@postgresql.org> <22763.1565566888@sss.pgh.pa.us> Subject: Re: BUG #15948: TRGM gin index is not be taken into account when using like all (array) MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev59 X-Originating-Client: open-xchange-app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VHFWRSJqxWRcj6rpYCQj/jeWEhcQ8LWOKjtUoCouec qfxZzWh List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk


On August 12, 2019 at 1:4= 1 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:


PG Bug reporting form <
noreply@postgresql.org> writes:
-- Now try to query all record which contain "36dedd" AND= "4e45f"
-- Using LIKE ALL, a seq scan is used which is very exp= ensive
explain analyze
select * from mytable where mytext like all (a= rray['%36dedd%','%4e45f%']);

This is not a = bug. At most it's an unimplemented feature ...
one I can't get v= ery excited about, considering how little
use there is for such queries.=

regards, tom lane

Thanks for the clarification. I j= ust stumbled about this because

select * from mytable w= here mytext like any (array['%36dedd%','%4e45f%'])=

uses the gin index the same way as

select= * from mytable where mytext like '%36dedd%' or mytext like '%4= e45f%'

does.


Its not a show stop= per in any way, but for me a working

select * from myta= ble where mytext like all (array['%36dedd%','%4e45f%'])

would be more elegant and more readable, because I am de= aling with big amounts of free text columns.

Although I use full text= search on those columns, I have a need to identify records where different= search strings are contained (front and end masked, like '%part%')= . This is because the free texts have many compound words, where I want to = find words containing specific search strings.


Maybe t= his could be a good starting point for me for becoming involved. Could some= one point me to the relevant source code area where this "LIKE = ALL" handling should be implemented?!

=20