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 D91E0D725B for ; Wed, 24 Aug 2005 02:57:31 -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 22522-05 for ; Wed, 24 Aug 2005 05:57:29 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 7F235D7233 for ; Wed, 24 Aug 2005 02:57:26 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j7O5ui65021701; Wed, 24 Aug 2005 01:56:44 -0400 (EDT) To: "Jeffrey W. Baker" Cc: Guy Thornley , Josh Berkus , pgsql-performance@postgresql.org, Steve Poe , Chris Browne Subject: Re: Read/Write block sizes In-reply-to: <1124861121.11270.1.camel@noodles> References: <60k6icpapm.fsf@dba2.int.libertyrms.com> <1124846743.12045.94.camel@amd64-laptop-spoe> <200508231931.29682.josh@agliodbs.com> <1124852854.11147.5.camel@noodles> <20050824052023.GB31806@conker.esphion.com> <1124861121.11270.1.camel@noodles> Comments: In-reply-to "Jeffrey W. Baker" message dated "Tue, 23 Aug 2005 22:25:21 -0700" Date: Wed, 24 Aug 2005 01:56:44 -0400 Message-ID: <21700.1124863004@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200508/377 X-Sequence-Number: 14124 "Jeffrey W. Baker" writes: > On Wed, 2005-08-24 at 17:20 +1200, Guy Thornley wrote: >> Dont forget that already in postgres, you have a process per connection, and >> all the processes take care of their own I/O. > That's the problem. Instead you want 1 or 4 or 10 i/o slaves > coordinating the I/O of all the backends optimally. For instance, with > synchronous scanning. And why exactly are we going to do a better job of I/O scheduling than the OS itself can do? There's a fairly basic disconnect in viewpoint involved here. The old-school viewpoint (as embodied in Oracle and a few other DBMSes) is that the OS is too stupid to be worth anything, and the DB should bypass the OS to the greatest extent possible, doing its own caching, disk space layout, I/O scheduling, yadda yadda. That might have been defensible twenty-odd years ago when Oracle was designed. Postgres prefers to lay off to the OS anything that the OS can do well --- and that definitely includes caching and I/O scheduling. There are a whole lot of smart people working on those problems at the OS level. Maybe we could make marginal improvements on their results after spending a lot of effort reinventing the wheel ... but our time will be repaid much more if we work at levels that the OS cannot have knowledge of, such as join planning and data statistics. There are some things we could do to reduce the impedance between us and the OS --- for instance, the upthread criticism that a seqscan asks the OS for only 8K at a time is fair enough. But that doesn't translate to a conclusion that we should schedule the I/O instead of the OS. regards, tom lane