Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPApF-0001S0-OZ for pgsql-docs@arkaria.postgresql.org; Thu, 05 Jan 2017 16:23:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cPApF-0007bH-Bi for pgsql-docs@arkaria.postgresql.org; Thu, 05 Jan 2017 16:23:37 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cPApE-0007at-OD for pgsql-docs@postgresql.org; Thu, 05 Jan 2017 16:23:36 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cPApB-0007kS-Ah for pgsql-docs@postgresql.org; Thu, 05 Jan 2017 16:23:35 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1cPAp9-0007xg-QE; Thu, 05 Jan 2017 11:23:31 -0500 Date: Thu, 5 Jan 2017 11:23:31 -0500 From: Bruce Momjian To: loren.szendre@gmail.com Cc: pgsql-docs@postgresql.org Subject: Re: case-insensitive index lower() Message-ID: <20170105162331.GA3265@momjian.us> References: <20161220100242.25618.66302@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161220100242.25618.66302@wrigleys.postgresql.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -5.1 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org On Tue, Dec 20, 2016 at 10:02:42AM +0000, loren.szendre@gmail.com wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/9.1/static/sql-createindex.html > Description: > > In the section on indexes the documentation accurately describes how to > create an efficient, case-insensitive index using lower(field_name). But! in > Firebird to get a query to utilize such index, you must write the query as > such: > > WHERE myfield = lower(:myfield) > > Otherwise a table scan is performed. The documentation should state whether > or not such a thing is required. It's one thing to create an index, it's > quite another to know how to write a statement that guarantees that the > index will be used. I don't see that as useful for the majority of people reading the documentation. EXPLAIN will clearly show the index being used. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs