pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: James Inform <james.inform@pharmapp.de>
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15948: TRGM gin index is not be taken into account when using like all (array)
Date: Mon, 12 Aug 2019 11:57:00 +0200 (CEST)
Message-ID: <741027258.89460.1565603820750@email.ionos.de> (raw)
In-Reply-To: <22763.1565566888@sss.pgh.pa.us>
References: <15948-8767af672d99063a@postgresql.org>
	<22763.1565566888@sss.pgh.pa.us>

<!DOCTYPE html>
<html><head>
    <meta charset="UTF-8">
</head><body><p><br></p><blockquote type="cite">On August 12, 2019 at 1:41 AM Tom Lane &#60;<a href="mailto:tgl@sss.pgh.pa.us">tgl@sss.pgh.pa.us</a>&#62; wrote:<br><br><br>PG Bug reporting form &#60;<a href="mailto:noreply@postgresql.org">noreply@postgresql.org</a>&#62; writes:<blockquote type="cite">-- Now try to query all record which contain &#34;36dedd&#34; AND &#34;4e45f&#34;<br>-- Using LIKE ALL, a seq scan is used which is very expensive<br>explain analyze<br>select * from mytable where mytext like all (array[&#39;%36dedd%&#39;,&#39;%4e45f%&#39;]);</blockquote><br>This is not a bug. At most it&#39;s an unimplemented feature ...<br>one I can&#39;t get very excited about, considering how little<br>use there is for such queries.<br><br> regards, tom lane</blockquote><p>Thanks for the clarification. I just stumbled about this because</p><p><code><strong>select * from mytable where mytext like any (array[&#39;%36dedd%&#39;,&#39;%4e45f%&#39;])</strong></code></p><p>uses the gin index the same way as</p><p><code><strong>select * from mytable where mytext like &#39;%36dedd%&#39; or mytext like &#39;%4e45f%&#39;</strong></code></p><p>does.</p><p><br></p><p>Its not a show stopper in any way, but for me a working</p><p><strong><code>select * from mytable where mytext like all (array[&#39;%36dedd%&#39;,&#39;%4e45f%&#39;])</code></strong></p><p>would be more elegant and more readable, because I am dealing with big amounts of free text columns.</p><p>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 &#39;%part%&#39;). This is because the free texts have many compound words, where I want to find words containing specific search strings.</p><p><br></p><p><em>Maybe this could be a good starting point for me for becoming involved. Could someone point me to the relevant source code area where this <strong>&#34;LIKE ALL&#34;</strong> handling should be implemented?!</em></p></body></html>
 





view thread (3+ messages)

Message-ID: <741027258.89460.1565603820750@email.ionos.de>
Permalink:  ../741027258.89460.1565603820750@email.ionos.de/
Also on:    postgresql.org/message-id/741027258.89460.1565603820750@email.ionos.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: james.inform@pharmapp.de
  Subject: Re: BUG #15948: TRGM gin index is not be taken into account when using like all (array)
  In-Reply-To: <741027258.89460.1565603820750@email.ionos.de>
  References: <15948-8767af672d99063a@postgresql.org> <22763.1565566888@sss.pgh.pa.us> <741027258.89460.1565603820750@email.ionos.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox