pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: mark <dvlhntr@gmail.com>
Cc: Gabriele Bartolini <gabriele.bartolini@2ndquadrant.it>
Cc: pgsql-admin@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] locales and encodings Oh MY!
Date: Fri, 12 Nov 2010 14:03:53 -0500
Message-ID: <14524.1289588633@sss.pgh.pa.us> (raw)
In-Reply-To: <AANLkTinNMd9C50JbvNW3qS+DjMMcLy_raYkaPExcTHYZ@mail.gmail.com>
References: <000001cb8211$c4c91b00$4e5b5100$@com>
	<4CDCF083.2040004@2ndQuadrant.it>
	<AANLkTim-gz8BP=peGZBANVZk1S0he_0SAMoLdYAT_Rps@mail.gmail.com>
	<AANLkTinNMd9C50JbvNW3qS+DjMMcLy_raYkaPExcTHYZ@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:
>> With how similar straight C and en_US.UTF8 are it was suggested to me,
>> by persons who are far more C knowledgeable then I in my office, that
>> this is something the PG community could "fix" . A "fix" being so that
>> "col LIKE 'foo%' " could use btree indexes in locales like en_US.UTF8
>> (and probably some others).

>> is the request unreasonable ? anyone got any idea of the price tag to
>> make that happen ?

> I thought it already did that.

No, and the odds of it ever happening are insignificant.  The sort order
associated with en_US (and other "dictionary order" locales) is just too
randomly different from what you need to optimize a LIKE search.
(Whoever told you en_US sorts similarly to C is nuts.)

The solution if you want the database's prevailing sort order to be en_US
is to put an extra text_pattern_ops index on the column you want to do
LIKE searches on.  We might eventually have the ability to spell that
"put a C-locale index on the column", but text_pattern_ops is the way to
do it today.

			regards, tom lane



view thread (7+ messages)  latest in thread

Message-ID: <14524.1289588633@sss.pgh.pa.us>
Permalink:  ../14524.1289588633@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14524.1289588633@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, dvlhntr@gmail.com, gabriele.bartolini@2ndquadrant.it, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] locales and encodings Oh MY!
  In-Reply-To: <14524.1289588633@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox