Re: case-insensitive index lower()

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: loren(dot)szendre(at)gmail(dot)com
Cc: pgsql-docs(at)postgresql(dot)org
Subject: Re: case-insensitive index lower()
Date: 2017-01-05 16:23:31
Message-ID: 20170105162331.GA3265@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Tue, Dec 20, 2016 at 10:02:42AM +0000, loren(dot)szendre(at)gmail(dot)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&#39;s one thing to create an index, it&#39;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 <bruce(at)momjian(dot)us> 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 +

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Magnus Hagander 2017-01-06 13:56:35 Re: Questionable tag usage
Previous Message Tom Lane 2017-01-05 04:50:11 Re: [HACKERS] Questionable tag usage