Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 85E031336DB6 for ; Tue, 19 Oct 2010 11:36:18 -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 79544-04 for ; Tue, 19 Oct 2010 14:36:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id B9C9A13364DE for ; Tue, 19 Oct 2010 11:36:10 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o9JEa9BY010134; Tue, 19 Oct 2010 10:36:09 -0400 (EDT) To: Jon Nelson cc: pgsql-performance@postgresql.org Subject: Re: odd postgresql performance (excessive lseek) In-reply-to: References: Comments: In-reply-to Jon Nelson message dated "Tue, 19 Oct 2010 08:10:47 -0500" Date: Tue, 19 Oct 2010 10:36:09 -0400 Message-ID: <10133.1287498969@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/307 X-Sequence-Number: 40725 Jon Nelson writes: > This is another situation where using pread would have saved a lot of > time and sped things up a bit, but failing that, keeping track of the > file position ourselves and only lseek'ing when necessary would also > help. No, it wouldn't; you don't have the slightest idea what's going on there. Those lseeks are for the purpose of detecting the current EOF location, ie, finding out whether some other backend has extended the file recently. We could get rid of them, but only at the cost of putting in some other communication mechanism instead. regards, tom lane