Re: Re: New Linux xfs/reiser file systems - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: New Linux xfs/reiser file systems
Date
Msg-id 23904.988896791@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: New Linux xfs/reiser file systems  (Matthew Kirkwood <matthew@hairy.beasts.org>)
Responses Re: Re: New Linux xfs/reiser file systems  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Matthew Kirkwood <matthew@hairy.beasts.org> writes:
> From some stracing of 7.1, the most common syscall issued by
> postgres is an lseek() to the end of the file, presumably to
> find its length, which seems to happen up to about a dozen
> times per (pgbench) transaction.

> Tablespaces would solve this (not that lseek is a particularly
> expensive operation, of course).

No, they wouldn't; or at least they'd just create a different problem.
The reason for the lseek is that the file length may have changed since
the current backend last checked it.  To avoid lseek we'd need some
shared data structure that maintains the current length of every active
table, which would be a nuisance to maintain and probably a source of
contention delays.

(Of course, such a data structure would just be the tip of the iceberg
of what we'd have to maintain for ourselves if we couldn't depend on the
kernel to do it for us.  Reimplementing a filesystem doesn't strike me
as a profitable use of our time.)
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Mauricio Breternitz"
Date:
Subject: Re: PostgreSQL replication
Next
From: Zeugswetter Andreas SB
Date:
Subject: AW: \c connects as another user instead I want in psql