Re: odd postgresql performance (excessive lseek)

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jon Nelson <jnelson+pgsql(at)jamponi(dot)net>, pgsql-performance(at)postgresql(dot)org
Subject: Re: odd postgresql performance (excessive lseek)
Date: 2010-10-27 03:05:10
Message-ID: AANLkTi=8Pkj-mgtcxv-1fyix5zECGock-rOn=G=NDXrU@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Oct 19, 2010 at 10:36 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Jon Nelson <jnelson+pgsql(at)jamponi(dot)net> 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.

I don't get it. Why would be doing that in a tight loop within a
single backend?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Divakar Singh 2010-10-27 03:10:56 Re: Postgres insert performance and storage requirement compared to Oracle
Previous Message Robert Haas 2010-10-27 02:56:07 Re: HashJoin order, hash the large or small table? Postgres likes to hash the big one, why?