Re: Index Scans become Seq Scans after VACUUM ANALYSE

Doug McNaught <doug@wireboard.com>

From: Doug McNaught <doug@wireboard.com>
To: mlw <markw@mohawksoft.com>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>, Andrew Sullivan <andrew@libertyrms.info>, PostgreSQL-development <pgsql-hackers@postgresql.org>, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2002-04-17T21:55:14Z
Lists: pgsql-hackers
mlw <markw@mohawksoft.com> writes:

> 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. 

Disagree.

> 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 readahead is active (and it should be for sequential reads) there
is still a pretty good chance that the next few disk blocks will be in
cache next time you get scheduled.

If your disk is thrashing that badly, you need more RAM and/or more
spindles; using an index will just put even more load on the i/o
system.

-Doug
-- 
Doug McNaught       Wireboard Industries      http://www.wireboard.com/

      Custom software development, systems and network consulting.
      Java PostgreSQL Enhydra Python Zope Perl Apache Linux BSD...