Re: adding new pages bulky way - Mailing list pgsql-hackers

From Qingqing Zhou
Subject Re: adding new pages bulky way
Date
Msg-id d83cef$u89$1@news.hub.org
Whole thread Raw
In response to adding new pages bulky way  ("Victor Y. Yegorov" <viy@mits.lv>)
List pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> writes
>
> I very seriously doubt that there would be *any* win, and I doubt even
> more that it could possibly be worth the klugery you'd have to do to
> make it happen.  Bear in mind that index access methods are two API
> layers away from md.c --- how will you translate this into something
> that makes sense in the context of bufmgr's API?
>

Index access or heap access doesn't matter. The imaginary plan is like this:

-- change 1 -- 
/* md.c */
mdextend()
{   mdextend_several_pages();   add_pages_to_FSM();
}

-- change 2 -- 
/** Any places hold relation extension lock*/

if (needLock) LockPage(relation, 0, ExclusiveLock);

/* ADD: check again here */
if (InvalidBlockNumber != GetPageWithFreeSpace())   UnlockPage(relation, 0, ExclusiveLock);

/* I have to do the extension */
buffer = ReadBuffer(relation, P_NEW);

Above code is quite like how we handle xlogflush() currently.





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: adding new pages bulky way
Next
From: Junji TERAMOTO
Date:
Subject: Re: Quick-and-dirty compression for WAL backup blocks