Re: non index use on LIKE on a non pattern string

Поиск
Список
Период
Сортировка
От Cédric Villemain
Тема Re: non index use on LIKE on a non pattern string
Дата
Msg-id 201206081351.54589.cedric@2ndquadrant.com
обсуждение исходный текст
Ответ на non index use on LIKE on a non pattern string  (Guillaume Cottenceau <gc@mnc.ch>)
Ответы Re: non index use on LIKE on a non pattern string  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
> I have noticed that with a SELECT query containing the following
> constraint:
>
>     column LIKE ?
>
> and an index on that column, PostgreSQL will not use the index
> even if the parameter doesn't contain special pattern characters
> such as %.

you should have a postgresql 8.3,isn't it ?
 like is equal to "=" in your case, since 8.4

Also you probably want to have a look at
 http://www.postgresql.org/docs/9.1/static/indexes-opclass.html
about your index definition (add the "text_pattern_ops" when required)

--
Cédric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - Développement, Expertise et Formation

Вложения

В списке pgsql-performance по дате отправления:

Предыдущее
От: Guillaume Cottenceau
Дата:
Сообщение: non index use on LIKE on a non pattern string
Следующее
От: Rural Hunter
Дата:
Сообщение: how to change the index chosen in plan?