Using indices with LIKE

From: "Llew Sion Goodstadt" <leo(dot)goodstadt(at)human-anatomy(dot)oxford(dot)ac(dot)uk>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-sql(at)postgresql(dot)org>
Subject: Using indices with LIKE
Date: 2002-01-26 20:19:19
Message-ID: 001101c1a6a6$bc00de40$1c1d01a3@FGU028
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thanks. You have saved my life!
I should perhaps have noticed the bit in the administrator's guide on
localisation.
Never thought it would be relevant.
I have reloaded the database after a new initdb and restarting
postmaster after changing the environment ("export LANG=C").
Everything now works.

(I write in all this detail so that the next poor sod doesn't have to go
through the same hellish experience :->

Llew

> Probably you initialized the database in non-C locale.
> Anchored searches can only be optimized with index scans in C
> locale; the index ordering isn't necessarily right in other locales.
>
> You can check the database locale with
> contrib/pg_controldata, or if that's not handy try
> od -c $PGDATA/global/pg_control
> and look for locale names near the end of the file.
>
> regards, tom lane
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an
> appropriate subscribe-nomail command to
> majordomo(at)postgresql(dot)org so that your message can get through
> to the mailing list cleanly
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message fstelpstra@yahoo.com 2002-01-26 21:06:25 Re: PGACCESS installation
Previous Message Tom Lane 2002-01-26 18:05:02 Re: Resources