Re: 335 times faster (!)

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Mikael Carneholm <carniz(at)spray(dot)se>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: 335 times faster (!)
Date: 2003-02-03 18:11:19
Message-ID: 20030203181119.GC29329@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Feb 03, 2003 at 18:42:31 +0100,
Mikael Carneholm <carniz(at)spray(dot)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 has a default btree index as created by the primary key constraint. However, when searching for the same row on one of it's columns (type: text) which has a functional index on lower(column name), the same row was retrieved in 19ms! That's ~335 times 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mikael Carneholm 2003-02-03 18:26:57 Re: 335 times faster (!)
Previous Message Nigel J. Andrews 2003-02-03 17:59:12 Re: 335 times faster (!)