X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 63494D71EC for ; Tue, 23 Aug 2005 20:44:16 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 59901-03 for ; Tue, 23 Aug 2005 23:44:15 +0000 (GMT) Received: from gghcwest.com (adsl-71-128-90-172.dsl.pltn13.pacbell.net [71.128.90.172]) by svr1.postgresql.org (Postfix) with ESMTP id 80621D714E for ; Tue, 23 Aug 2005 20:44:13 -0300 (ADT) Received: from toonses.gghcwest.com (toonses.gghcwest.com [192.168.168.115]) by gghcwest.com (8.12.10/8.12.9) with ESMTP id j7NNi8md020032; Tue, 23 Aug 2005 16:44:09 -0700 Received: from jwb by toonses.gghcwest.com with local (Exim 4.50) id 1E7iR8-00044n-RC; Tue, 23 Aug 2005 16:44:10 -0700 Subject: Re: Read/Write block sizes (Was: Caching by Postgres) From: "Jeffrey W. Baker" To: Michael Stone Cc: Jignesh Shah , pgsql-performance@postgresql.org In-Reply-To: <20050823231238.GL8667@mathom.us> References: <20050823231238.GL8667@mathom.us> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Tue, 23 Aug 2005 16:44:10 -0700 Message-Id: <1124840650.12932.1.camel@toonses.gghcwest.com> Mime-Version: 1.0 X-Mailer: Evolution 2.3.6.1 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=-0.714 required=5 tests=[AWL=-0.764, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200508/365 X-Sequence-Number: 14112 On Tue, 2005-08-23 at 19:12 -0400, Michael Stone wrote: > On Tue, Aug 23, 2005 at 05:29:01PM -0400, Jignesh Shah wrote: > >Actually some of that readaheads,etc the OS does already if it does > >some sort of throttling/clubbing of reads/writes. > > Note that I specified the fully cached case--even with the workload in > RAM the system still has to process a heck of a lot of read calls. > > >* Introduce a multiblock or extent tunable variable where you can > >define a multiple of 8K (or BlockSize tuneable) to read a bigger chunk > >and store it in the bufferpool.. (Maybe writes too) (Most devices now > >support upto 1MB chunks for reads and writes) > > Yeah. The problem with relying on OS readahead is that the OS doesn't > know whether you're doing a sequential scan or an index scan; if you > have the OS agressively readahead you'll kill your seek performance. > OTOH, if you don't do readaheads you'll kill your sequential scan > performance. At the app level you know which makes sense for each > operation. This is why we have MADVISE_RANDOM and MADVISE_SEQUENTIAL. -jwb