Re: Relation extension scalability - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Relation extension scalability
Date
Msg-id 20160107112341.5md4r2237hvanoxw@alap3.anarazel.de
Whole thread Raw
In response to Re: Relation extension scalability  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: Relation extension scalability  (Dilip Kumar <dilipbalaut@gmail.com>)
List pgsql-hackers
On 2016-01-07 16:48:53 +0530, Amit Kapila wrote:
> What I could understand from above e-mail is that Dilip has tried to
> extend relation multiple-pages-at-a-time and observed that it gives
> comparable or better performance as compare to Andres's idea of
> lock-free extension and it doesn't regress the low-thread count case.

I think it's a worthwhile approach to pursue. But until it actually
fixes the problem of leaving around uninitialized pages I don't think
it's very meaningful to do performance comparisons.

> Now, I think here point to discuss is that there could be multiple-ways
> for extending a relation multiple-pages-at-a-time like:
> 
> a. Extend the relation page by page and add it to FSM without initializing
> it.  I think this is what the current patch of Dilip seems to be doing. If
> we
> want to go via this route, then we need to ensure that whenever we get
> the page from FSM, if it is empty and not initialised, then initialise
> it.

I think that's pretty much unacceptable, for the non-error path at
least.

One very simple, linux specific, approach would be to simply do
fallocate(FALLOC_FL_KEEP_SIZE) to extend the file, that way space is
pre-allocated, but not yet marked as allocated.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Relation extension scalability
Next
From: Dilip Kumar
Date:
Subject: Re: parallel joins, and better parallel explain