Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id F2E6CB5DBC1 for ; Mon, 26 Sep 2011 05:26:58 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 53946-02 for ; Mon, 26 Sep 2011 08:26:52 +0000 (UTC) X-Greylist: delayed 00:27:04.967675 by SQLgrey-1.8.0-rc2 Received: from mail-vw0-f46.google.com (mail-vw0-f46.google.com [209.85.212.46]) by mail.postgresql.org (Postfix) with ESMTP id 6B51BB5DBC0 for ; Mon, 26 Sep 2011 05:26:52 -0300 (ADT) Received: by vws1 with SMTP id 1so5493303vws.19 for ; Mon, 26 Sep 2011 01:26:52 -0700 (PDT) Received: by 10.52.23.132 with SMTP id m4mr5667926vdf.277.1317023985635; Mon, 26 Sep 2011 00:59:45 -0700 (PDT) Received: from [10.1.1.6] (58-7-170-220.dyn.iinet.net.au. [58.7.170.220]) by mx.google.com with ESMTPS id bi11sm16860839vdb.13.2011.09.26.00.59.43 (version=SSLv3 cipher=OTHER); Mon, 26 Sep 2011 00:59:45 -0700 (PDT) Message-ID: <4E8030EB.60105@ringerc.id.au> Date: Mon, 26 Sep 2011 15:59:39 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 To: Antonio Rodriges CC: pgsql-performance@postgresql.org Subject: Re: [PERFORMANCE] Insights: fseek OR read_cluster? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/362 X-Sequence-Number: 45138 On 24/09/2011 2:49 PM, Antonio Rodriges wrote: > Hello, > > It is interesting how PostgreSQL reads the tablefiie. > Whether its indexes store/use filesystem clusters locations containing > required data (so it can issue a low level cluster read) or it just > fseeks inside a file? What is read_cluster() ? Are you talking about some kind of async and/or direct I/O? If so, PostgreSQL is not designed for direct I/O, it benefits from using the OS's buffer cache, I/O scheduler, etc. IIRC Pg uses pread() to read from its data files, but I didn't go double check in the sources to make sure. -- Craig Ringer