Received: from gromit.dotclick.com ([64.2.137.178]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0BIwSB96898 for ; Fri, 11 Jan 2002 13:58:28 -0500 (EST) (envelope-from markw@mohawksoft.com) Received: from mohawksoft.com (IDENT:markw@localhost.localdomain [127.0.0.1]) by gromit.dotclick.com (8.9.3/8.9.3) with ESMTP id NAA29662; Fri, 11 Jan 2002 13:58:09 -0500 Message-ID: <3C3F35C1.871D6FC4@mohawksoft.com> Date: Fri, 11 Jan 2002 13:58:09 -0500 From: mlw X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.4.16 i686) X-Accept-Language: en MIME-Version: 1.0 To: Tom Lane CC: Zeugswetter Andreas SB SD , Bruce Momjian , Daniel Kalchev , pgsql-hackers@postgresql.org Subject: Re: again on index usage References: <46C15C39FEB2C44BA555E356FBCD6FA42128AD@m0114.s-mxs.net> <29287.1010766847@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200201/492 X-Sequence-Number: 17517 Tom Lane wrote: > What I think you are saying is that when there's lots of competing work, > seqscans have less advantage over indexscans because the > sequential-access locality advantage is lost when the disk drive has to > go off and service some other request. If that's the mechanism, I think > that the appropriate answer is just to reduce random_page_cost. It's > true that the current default of 4.0 was chosen using measurements on > otherwise-unloaded systems. If you assume that the system is (a) too > busy to do read-aheads for you, and (b) has to move the disk arm to > service other requests between each of your requests, then it's not > clear that sequential reads have any performance advantage at all :-(. > I don't think I'd go as far as to lower random_page_cost to 1.0, but > certainly there's a case for using an intermediate value. It is even more interesting than simple sequential vs random scan thinking. Depending on the maker of the drive, even an unloaded system will move the head randomly. Modern drives have almost no resemblance to their predecessors. Sectors are mapped however the OEM sees fit. A numerically sequential read from a hard disk may have the drive heads bouncing all over the disk because the internal configuration of the disk has almost nothing to do with the external representation. Think about a RAID device. What does a sequential scan mean to a RAID system? Very little depending on how the image is constructed. Storage devices are now black boxes. The only predictable advantage a "sequential scan" can have on a modern computer is OS level caching.