Re: ORDER BY case insensitive?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Keith Gray <keith(at)heart(dot)com(dot)au>
Cc: Jason Earl <jdearl(at)yahoo(dot)com>, SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: ORDER BY case insensitive?
Date: 2001-10-05 00:32:08
Message-ID: 3175.1002241928@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Keith Gray <keith(at)heart(dot)com(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ross J. Reedstrom 2001-10-05 00:49:23 Re: Indexing behavior
Previous Message Keith Gray 2001-10-04 23:56:48 Re: ORDER BY case insensitive?