Re: sequence scan on PK

From: John A Meinel <john(at)arbash-meinel(dot)com>
To: Jeroen van Iddekinge <iddekingej(at)lycos(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: sequence scan on PK
Date: 2005-05-08 16:24:36
Message-ID: 427E3D44.4080503@arbash-meinel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Jeroen van Iddekinge wrote:
>
>>
>> You could tweak with several settings to get it to do an index scan
>> earlier, but these would probably break other queries. You don't need to
>> tune for 100 rows, morelike 100k or 100M.
>
>
> Thanks for respone.
> The index scan was a little bit faster for id=1 and faster for id=99.
>
> Which settings shoud I change for this? cpu_index_tuple_cost ,
> cpu_operator_cost, cpu_tuple_cost?
>
>
> Jer.

Well, I would start with *don't*. You are only looking at one query,
which is pretty much fast already, and probably is not going to be the
bottleneck. You are optimizing the wrong thing.

That being said, because you have everything cached in ram (since it is
a tiny table), you probably would set random_page_cost = 2.

In theory it should really never be lower than 2, though if you are
trying to force an index scan you can do it.

John
=:->

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2005-05-08 16:49:19 Re: sequence scan on PK
Previous Message Matteo Beccati 2005-05-08 16:18:46 Re: sequence scan on PK