<!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 <<a href="mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us">tgl(at)sss(dot)pgh(dot)pa(dot)us</a>> wrote:<br><br><br>PG Bug reporting form <<a href="mailto:noreply(at)postgresql(dot)org">noreply(at)postgresql(dot)org</a>> writes:<blockquote type="cite">-- Now try to query all record which contain "36dedd" AND "4e45f"<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['%36dedd%','%4e45f%']);</blockquote><br>This is not a bug. At most it's an unimplemented feature ...<br>one I can'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['%36dedd%','%4e45f%'])</strong></code></p><p>uses the gin index the same way as</p><p><code><strong>select * from mytable where mytext like '%36dedd%' or mytext like '%4e45f%'</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['%36dedd%','%4e45f%'])</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 '%part%'). 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>"LIKE ALL"</strong> handling should be implemented?!</em></p></body></html>