Skip site navigation (1) Skip section navigation (2)

Re: BUG #2050: Bad plan by using of LIKE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Johannes" <postgres(at)arltus(dot)de>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2050: Bad plan by using of LIKE
Date: 2005-11-18 14:42:12
Message-ID: 5891.1132324932@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Johannes" <postgres(at)arltus(dot)de> writes:
> EXPLAIN SELECT title FROM content WHERE title LIKE 'teane%';
> Seq Scan on content  (cost=0.00..75647.59 rows=1 width=68)
>    Filter: (title ~~ 'teane%'::text)

Apparently you're using a non-C locale.  LIKE can only use an index if
you're in the C locale or you make the index with a special index
operator class.  See
http://www.postgresql.org/docs/8.0/static/indexes-opclass.html

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Bernhard WeisshuhnDate: 2005-11-18 14:52:51
Subject: Re: BUG #2050: Bad plan by using of LIKE
Previous:From: Jaime CasanovaDate: 2005-11-18 14:41:22
Subject: Re: BUG #2050: Bad plan by using of LIKE

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group