Re: Arg! PG not using index on an analyzed table

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Reece Hart <reece(at)harts(dot)net>, SF PostgreSQL <sfpug(at)postgresql(dot)org>
Subject: Re: Arg! PG not using index on an analyzed table
Date: 2005-02-02 19:10:59
Message-ID: 20050202110931.E63911@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: sfpug


On Wed, 2 Feb 2005, Josh Berkus wrote:

> Reece,
>
> > Does anyone know what's going on here? I vaguely remember that
> > postgresql keeps frequency estimates of words... is the problem that the
> > new db doesn't have such estimates and therefore incorrectly guesses
> > that an index is better?
>
> What encoding does the new box have? Postgres is generally unable to use an
> index on "begins with" queries unless the database has "C" encoding. One of
> the differences between your old Red Hat and your new SuSE is that the
> default shell encoding will have changed from "C" to "en_US". You may need
> to re-initdb with --locale='C' .

You may also be able to get away with another index on the column using
text_pattern_ops as the operator class if you need/want other en_US
features.

In response to

Responses

Browse sfpug by date

  From Date Subject
Next Message Josh Berkus 2005-02-02 19:15:53 Re: Arg! PG not using index on an analyzed table
Previous Message Josh Berkus 2005-02-02 19:06:53 Re: Arg! PG not using index on an analyzed table