Comment 4 for bug 387840

On Fri, Jun 19, 2009 at 6:57 PM, James Henstridge<email address hidden> wrote:
> I guess we could go with that.  I guess the difference would be in the
> generated SQL: "lower(Table.column) LIKE 'foo%'" vs. "Table.column ILIKE
> 'foo%'".  You probably know more than me about how these two compare
> performance wise.

For PostgreSQL, they generate identical plans and both make use of an index on lower(Table.column).

Mixing LIKE and lower() (or upper) is the SQL standard way of doing case insensitive searches. ILIKE is a PostgreSQL extension.

--
Stuart Bishop <email address hidden>
http://www.stuartbishop.net/