Re: ORDER BY case insensitive? - Mailing list pgsql-sql

From Tom Lane
Subject Re: ORDER BY case insensitive?
Date
Msg-id 3175.1002241928@sss.pgh.pa.us
Whole thread Raw
In response to Re: ORDER BY case insensitive?  (Keith Gray <keith@heart.com.au>)
List pgsql-sql
Keith Gray <keith@heart.com.au> writes:
> How would PostgreSQL know to use the index
> MyTable_lower_idx when I do a ...

> SELECT * FROM MyTable WHERE lower(name) LIKE 'jas%';

The same way it knows to use any other index: it matches up the things
mentioned in the WHERE clause with the available indexes, and then sees
whether the clauses they are mentioned in are comparisons that the index
can help with.  In this case the "thing" mentioned is "function(column)"
rather than just "column", but otherwise it's just like a simple index.
        regards, tom lane


pgsql-sql by date:

Previous
From: Keith Gray
Date:
Subject: Re: ORDER BY case insensitive?
Next
From: "Ross J. Reedstrom"
Date:
Subject: Re: Indexing behavior