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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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

Attachment: signature.asc
Description: This is a digitally signed message part.


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux