pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matthew Hall <mhall@mhcomputing.net>
To: pgsql-performance@lists.postgresql.org
Subject: Re: Query with "ILIKE ALL" does not use the index
Date: Thu, 26 Jul 2018 10:22:21 -0700
Message-ID: <460B4CB5-0D1D-43C8-829B-D7734A84779D@mhcomputing.net> (raw)
In-Reply-To: <17421.1532623454@sss.pgh.pa.us>
References: <CALghGHM72CTRyb7-ggFU-ubm3LfXqK019Y=WjP-JwzjzT8QDCA@mail.gmail.com>
	<17421.1532623454@sss.pgh.pa.us>

On Jul 26, 2018, at 9:44 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
> Nicolas Even <neven@ztel.org> writes:
>> However when I run the same (as far as I understand it) query but with
>> the ALL operator, the index is not used:
>> explain analyze select name from totoz where name ilike all(array['%tot%']);
> 
> There's only index support for "op ANY (array)", not "op ALL (array)".
> 
> 			regards, tom lane

Nicolas,

Could you work around the limitation with a two-clause WHERE?

First clause ANY, second clause ALL.

I've done some similar tricks on similar sorts of queries.

Matthew.



view thread (5+ messages)  latest in thread

Message-ID: <460B4CB5-0D1D-43C8-829B-D7734A84779D@mhcomputing.net>
Permalink:  ../460B4CB5-0D1D-43C8-829B-D7734A84779D@mhcomputing.net/
Also on:    postgresql.org/message-id/460B4CB5-0D1D-43C8-829B-D7734A84779D@mhcomputing.net

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: mhall@mhcomputing.net, pgsql-performance@lists.postgresql.org
  Subject: Re: Query with "ILIKE ALL" does not use the index
  In-Reply-To: <460B4CB5-0D1D-43C8-829B-D7734A84779D@mhcomputing.net>

* 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