Search Postgresql Archives

Are indexes used with LIKE?

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

 



Hi,

Are indexes on VARCHAR columns used with the LIKE operator, and if so, how efficiently are they used?

I can imagine that using indexes can be easy with the starting literal characters up to the first percent sign such as in:

LIKE 'ZOE%QQWE%'

But, after the first % sign, things can get more difficult.

The reason I am asking is that we are thinking about discriminating between rows of a table based on a VARCHAR column containing various one-character "flags". We could then use the LIKE operator for formulating filter conditions.

Any help is appreciated!

Regards
Peter


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux