Hello,
I have a table 'foo_bar' with a column 'col1' defined as
'col1 varchar(512)'. This column is indexed using an expression index
defined as
CREATE INDEX ix_foo_bar_by_col1 ON foo_bar(lower(col1) col1 varchar_pattern_ops)
The
problem is when I try matching using ILIKE, (col1 ILIKE 'foo%')
PostgreSQL does not use an index scan but a Seq scan of the whole
table, but when I try (lower(col1) LIKE 'foo%')
PostgreSQL uses an index scan.
Could this be a bug with ILIKE or am I missing something?
The table has ~ 4 million rows.
PostgreSQL 8.3.5 on Windows Vista, non C locale, DB encoding is LATIN1.
Thank you in advance,
Milos.
_________________________________________________________________
Want to marry your mail? Combine your email accounts here!
http://livelife.ninemsn.com.au/article.aspx?id=633386