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

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

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' .

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse sfpug by date

  From Date Subject
Next Message Stephan Szabo 2005-02-02 19:10:59 Re: Arg! PG not using index on an analyzed table
Previous Message Reece Hart 2005-02-02 16:57:25 Arg! PG not using index on an analyzed table