Skip site navigation (1) Skip section navigation (2)

Re: odd postgresql performance (excessive lseek)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
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:57:41
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Tue, Oct 19, 2010 at 10:36 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> 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?

Well, we weren't shown any context whatsoever about what the backend was
actually doing ... but for example the planner likes to recheck the
current physical size of each relation in a query, so that it's working
with an up-to-date number.  That could probably be avoided, since an
estimate would be good enough as long as it wasn't horribly stale.
But there are other places that *have* to have the accurate size, like
seqscan startup.  I doubt it was as tight a loop as all that.  It
wouldn't be hard at all to have an example where those lseeks are the
only operations visible to strace, if all the data the backend needs is
in shared buffers.

			regards, tom lane

In response to

pgsql-performance by date

Next:From: Rob WultschDate: 2010-10-27 04:41:55
Subject: Re: BBU Cache vs. spindles
Previous:From: Tom LaneDate: 2010-10-27 03:48:04
Subject: Re: HashJoin order, hash the large or small table? Postgres likes to hash the big one, why?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group