Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f950Wwn18721 for ; Thu, 4 Oct 2001 20:32:58 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id f950W9I03178; Thu, 4 Oct 2001 20:32:09 -0400 (EDT) To: Keith Gray cc: Jason Earl , SQL Subject: Re: ORDER BY case insensitive? In-reply-to: <3BBCF740.931A32AD@heart.com.au> References: <20011004212255.3654.qmail@web10002.mail.yahoo.com> <3BBCF740.931A32AD@heart.com.au> Comments: In-reply-to Keith Gray message dated "Fri, 05 Oct 2001 09:56:48 +1000" Date: Thu, 04 Oct 2001 20:32:08 -0400 Message-ID: <3175.1002241928@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200110/73 X-Sequence-Number: 5028 Keith Gray 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