Re: 335 times faster (!) - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: 335 times faster (!)
Date
Msg-id 20030203181119.GC29329@wolff.to
Whole thread Raw
In response to 335 times faster (!)  (Mikael Carneholm <carniz@spray.se>)
List pgsql-general
On Mon, Feb 03, 2003 at 18:42:31 +0100,
  Mikael Carneholm <carniz@spray.se> wrote:
> I discovered a strange thing when doing a simple search on a (comparably) large table with ~900K rows today:
>
> When searching for a specific row on the primary key (type: bigint), the search took about 6,5 seconds. The column
hasa default btree index as created by the primary key constraint. However, when searching for the same row on one of
it'scolumns (type: text) which has a functional index on lower(column name), the same row was retrieved in 19ms! That's
~335times faster! 

This is probably a type coersion issue. You can probably get the first search
to run much faster by including an explicit cast to bigint.

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Drop constraint in PostgreSQL 7.1.2
Next
From: "Nigel J. Andrews"
Date:
Subject: Re: 335 times faster (!)