From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andreas Kostyrka <andreas@mtg.co.at>
Cc: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Cc: pgsql-performance@postgresql.org
Subject: Re: Index not used, performance problem
Date: Sat, 29 Mar 2003 18:13:28 -0500
Message-ID: <935.1048979608@sss.pgh.pa.us> (raw)
In-Reply-To: <1048957078.7539.17.camel@andi-lap>
References: <20030329214139.N4697-100000@houston.familyhealth.com.au>
<1048957078.7539.17.camel@andi-lap>
Andreas Kostyrka <andreas@mtg.co.at> writes:
> On Sat, 2003-03-29 at 14:47, Christopher Kings-Lynne wrote:
>> As for the LIKE searches, the only ones that PostgreSQL can index are of
>> the form 'FOO%', which is what you are doing. However, I believe that
>> PostgreSQL cannot do this if your database encoding is anything other than
>> 'C'. So, if you are using an Austrian encoding, it might not be able to
>> use the index.
> Well, I use LATIN1. How do I store 8-bit chars else?
You are both confusing locale with encoding. The LIKE optimization
requires 'C' locale, but it should work with any encoding (or at least
any single-byte encoding; not sure about multibyte).
> And if so, PostgreSQL seems quite strongly broken, because a
> relational database relies by design heavily on indexes.
Some of us would reply that the locales are broken ;-). The bizarre
sorting rules demanded by so many locales are what make it impossible
to optimize a LIKE prefix into an indexscan. See the archives for
the reasons why our many tries at this have failed.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, andreas@mtg.co.at, chriskl@familyhealth.com.au
Subject: Re: Index not used, performance problem
In-Reply-To: <935.1048979608@sss.pgh.pa.us>
References: <20030329214139.N4697-100000@houston.familyhealth.com.au> <1048957078.7539.17.camel@andi-lap> <935.1048979608@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