Re: bug: LC_CTYPE=en_US.UTF-8 confuses query planner

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dmitry Karasik <dk(at)catpipe(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: bug: LC_CTYPE=en_US.UTF-8 confuses query planner
Date: 2005-06-28 14:48:38
Message-ID: 15235.1119970118@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dmitry Karasik <dk(at)catpipe(dot)net> writes:
> When database is initdb'ed with LC_CTYPE=C, the query uses index
> scan; when LC_CTYPE=en_US.UTF-8 it is the sequential scan.

This is in the FAQ:

When using wild-card operators such as LIKE or ~, indexes can only be
used in certain circumstances:
...
* The default C locale must be used during initdb because it is not
possible to know the next-greatest character in a non-C locale.
You can create a special text_pattern_ops index for such cases
that work only for LIKE indexing.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-06-28 15:13:03 Re: initdb -W failure with role-capable catalogs
Previous Message Pavel Stehule 2005-06-28 14:36:10 Re: Implementing SQL/PSM for PG 8.2 - debugger