Re: Diff between Primary key and non primary key select

From: Richard Huxton <dev(at)archonet(dot)com>
To: Deepa <kdeepa(at)midascomm(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Diff between Primary key and non primary key select
Date: 2003-02-14 14:55:29
Message-ID: 200302141455.29744.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday 14 Feb 2003 12:30 pm, Deepa wrote:
> Base database size Time taken to select one record using one
> query in milliseconds
>
> With Primary key With Non primary Key
>
> 2000 15.8 15.7
> 10000 71.2 70.7
> 25000 174 173.5
> 100000 4319 3417
>
> In the above result, I cannot able to see much difference between
> the time consumed using primary key and non-primary key value. Even in
> some cases, I can able to see that using non primary key value retrieves
> record faster than using primary key.

What indexes do you have? How big are the fields?
If the above are figures for 1 row selected, then no indexes are used. You can
see what the system is doing with:

EXPLAIN ANALYSE SELECT (rest of query here)

> I did the above test several times and I am getting the same
> results. Can any one tell me, what could be the possible reason for this.
>
> I ran the above test in the following system configuration.
>
> SYSTEM CONFIGURATION
> ====================
>
> Hard Disk : 4.3 GB
> RAM : 64 MB
> Processor : Celeron - 566 MHz
> Swap space : 200 MB

Get more RAM! There's no space for PG to work in with only 64MB.

--
Richard Huxton

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Stark 2003-02-14 15:02:29 Re: Diff between Primary key and non primary key select
Previous Message Robert Treat 2003-02-14 13:29:08 Re: mailing list archives