pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Chetan Suttraway <chetan.suttraway@enterprisedb.com>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: Sam Wong <sam@hellosam.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: Index use difference betweer LIKE, LIKE ANY?
Date: Mon, 06 Jun 2011 12:47:10 +0300
Message-ID: <4DECA21E.2090307@enterprisedb.com> (raw)
In-Reply-To: <4DECA15B.2000809@enterprisedb.com>
References: <01e801cbd4f0$5153d840$f3fb88c0$@hellosam.net>
	<4D696CFE.2010107@agliodbs.com>
	<AANLkTi=bQuynYJY0v9O5V0JdMqMGJELXyAJjBCatW3Dg@mail.gmail.com>
	<4DECA15B.2000809@enterprisedb.com>

On 06.06.2011 12:43, Heikki Linnakangas wrote:
> Also, even when safe, it's not clear that the transformation is always a
> win. The left-hand expression could be expensive, in which case having
> to evaluate it multiple times could hurt performance. Maybe yo

Sorry, hit "send" too early.

Maybe you could put in some heuristic to only do the transformation when 
the left-hand expression is cheap, or maybe use something like the 
CaseTestExpr to avoid multiple evaluation and still use the OR form. 
Also, if the array is very large, opening it into the OR form could 
increase plan time substantially, so we'd probably only want to do it if 
there's any Vars involved, and thus any chance of matching an index.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com



view thread (6+ messages)

Message-ID: <4DECA21E.2090307@enterprisedb.com>
Permalink:  ../4DECA21E.2090307@enterprisedb.com/
Also on:    postgresql.org/message-id/4DECA21E.2090307@enterprisedb.com

 · 

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: heikki.linnakangas@enterprisedb.com, chetan.suttraway@enterprisedb.com, josh@agliodbs.com, sam@hellosam.net
  Subject: Re: Index use difference betweer LIKE, LIKE ANY?
  In-Reply-To: <4DECA21E.2090307@enterprisedb.com>

* 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