Re: wildcard search performance with "like"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Yantao Shi <y(dot)shi(at)larc(dot)nasa(dot)gov>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: wildcard search performance with "like"
Date: 2006-01-17 21:01:33
Message-ID: 21504.1137531693@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Yantao Shi <y(dot)shi(at)larc(dot)nasa(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2006-01-17 21:09:53 Re: sum of left join greater than its parts
Previous Message Jim C. Nasby 2006-01-17 20:58:28 Re: Suspending SELECTs