[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110916200817.GD28519@kvack.org>
Date: Fri, 16 Sep 2011 16:08:17 -0400
From: Benjamin LaHaise <bcrl@...ck.org>
To: Andres Freund <andres@...razel.de>
Cc: Matthew Wilcox <matthew@....cx>, Andi Kleen <andi@...stfloor.org>,
viro@...iv.linux.org.uk, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, robertmhaas@...il.com,
pgsql-hackers@...tgresql.org
Subject: Re: Improve lseek scalability v3
On Fri, Sep 16, 2011 at 07:27:33PM +0200, Andres Freund wrote:
> many tuples does the table have. Those statistics are only updated every now
> and then though.
> So it uses those old stats to check how many tuples are normally stored on a
> page and then uses that to extrapolate the number of tuples from the current
> nr of pages (which is computed by lseek(SEEK_END) over the 1GB segements of a
> table).
>
> I am not sure how interested you are on the relevant postgres internals?
For such tables, can't Postgres track the size of the file internally? I'm
assuming it's keeping file descriptors open on the tables it manages, in
which case when it writes to a file to extend it, the internally stored size
could be updated. Not making a syscall at all would scale far better than
even a modified lseek() will perform.
Granted, I've not looked at the Postgres code at all.
-ben
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists