pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guillaume Cottenceau <gc@mnc.ch>
To: pgsql-performance@postgresql.org
Subject: non index use on LIKE on a non pattern string
Date: Fri, 08 Jun 2012 13:11:11 +0200
Message-ID: <m3mx4eys6o.fsf@mnc.ch> (raw)

Hello,

I have noticed that with a SELECT query containing the following
constraint:

    column LIKE ?

and an index on that column, PostgreSQL will not use the index
even if the parameter doesn't contain special pattern characters
such as %.



view thread (4+ messages)  latest in thread

Message-ID: <m3mx4eys6o.fsf@mnc.ch>
Permalink:  ../m3mx4eys6o.fsf@mnc.ch/
Also on:    postgresql.org/message-id/m3mx4eys6o.fsf@mnc.ch

 · 

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: gc@mnc.ch
  Subject: Re: non index use on LIKE on a non pattern string
  In-Reply-To: <m3mx4eys6o.fsf@mnc.ch>

* 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