Re: Index Scans become Seq Scans after VACUUM ANALYSE

From: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
To: mlw <markw(at)mohawksoft(dot)com>
Cc: Andrew Sullivan <andrew(at)libertyrms(dot)info>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Index Scans become Seq Scans after VACUUM ANALYSE
Date: 2002-04-17 21:56:44
Message-ID: 20020417215647.0C9391AFA@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On April 17, 2002 05:44 pm, mlw wrote:
> It took a bike ride to think about this one. The supposed advantage of a
> sequential read over an random read, in an active multitasking system, is a
> myth. If you are executing one query and the system is doing only that
> query, you may be right.
>
> Execute a number of queries at the same time, the expected benefit of a
> sequential scan goes out the window. The OS will be fetching blocks, more
> or less, at random.

If it does you should look for another OS. A good OS will work with your
access requests to keep them as linear as possible. Of course it has a
slight effect the other way as well but generally lots of sequential reads
will be faster than lots of random ones. If you don't believe that then just
run the test that Tom suggested to calculate random_tuple_cost on your own
system. I bet your number is higher than 1.

And when you are done, just plug the number into your configuration and get
the plans that you are looking for.

--
D'Arcy J.M. Cain <darcy(at){druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-04-17 21:56:46 Re: regexp character class locale awareness patch
Previous Message mlw 2002-04-17 21:56:15 Re: Index Scans become Seq Scans after VACUUM ANALYSE