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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-bugs by date

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