Re: BUG #2050: Bad plan by using of LIKE - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2050: Bad plan by using of LIKE
Date
Msg-id 5891.1132324932@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2050: Bad plan by using of LIKE  ("Johannes" <postgres@arltus.de>)
List pgsql-bugs
"Johannes" <postgres@arltus.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

pgsql-bugs by date:

Previous
From: Sarunas Krisciukaitis
Date:
Subject: Re: Double sequence increase on single insert with RULE on
Next
From: Jaime Casanova
Date:
Subject: Re: BUG #2050: Bad plan by using of LIKE