pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Yantao Shi <y.shi@larc.nasa.gov>
Cc: pgsql-performance@postgresql.org
Subject: Re: wildcard search performance with "like"
Date: Tue, 17 Jan 2006 16:01:33 -0500
Message-ID: <21504.1137531693@sss.pgh.pa.us> (raw)
In-Reply-To: <43CD4CE5.3020506@larcb.ecs.nasa.gov>
References: <43CD4CE5.3020506@larcb.ecs.nasa.gov>

Yantao Shi <y.shi@larc.nasa.gov> writes:
> testdbspc=# explain select file_name from catalog where file_name like 
> 'MOD04_L2.A2005311.%.004.2005312013%.hdf';
> QUERY PLAN
> Seq Scan on catalog  (cost=0.00..429.00 rows=1 width=404)
>   Filter: (file_name ~~ 'MOD04_L2.A2005311.%.004.2005312013%.hdf'::text)
> (2 rows)

I'm betting you are using a non-C locale.  You need either to run the
database in C locale, or to create a special index type that is
compatible with LIKE searches.  See
http://www.postgresql.org/docs/8.1/static/indexes-opclass.html

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <21504.1137531693@sss.pgh.pa.us>
Permalink:  ../21504.1137531693@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21504.1137531693@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, y.shi@larc.nasa.gov
  Subject: Re: wildcard search performance with "like"
  In-Reply-To: <21504.1137531693@sss.pgh.pa.us>

* 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