Re: [HACKERS] unnecessary code in_bt_split

2008-08-05 Thread Zdenek Kotala
Tom Lane napsal(a): Zdenek Kotala [EMAIL PROTECTED] writes: I'm thinking we should split PageGetTempPage into two versions: PageGetTempPage: get a temp page the same size as the given page, but don't initialize its contents at all (so, just a thin wrapper for palloc). This could be used by

Re: [HACKERS] unnecessary code in_bt_split

2008-08-04 Thread Simon Riggs
On Sun, 2008-08-03 at 19:44 -0400, Tom Lane wrote: Zdenek Kotala [EMAIL PROTECTED] writes: I found that _bt_split function calls PageGetTempPage, but next call is _bt_page_init which clear all contents anyway. Is there any reason to call PageGetTempPage instead of palloc? Not

Re: [HACKERS] unnecessary code in_bt_split

2008-08-04 Thread Zdenek Kotala
Tom Lane napsal(a): Zdenek Kotala [EMAIL PROTECTED] writes: I found that _bt_split function calls PageGetTempPage, but next call is _bt_page_init which clear all contents anyway. Is there any reason to call PageGetTempPage instead of palloc? Not violating a perfectly good abstraction? OK.

Re: [HACKERS] unnecessary code in_bt_split

2008-08-04 Thread Tom Lane
Zdenek Kotala [EMAIL PROTECTED] writes: Tom Lane napsal(a): Not violating a perfectly good abstraction? By my opinion It would be better to have three functions: PageCreateTempPage - only allocate memory and call pageinit PageCloneSpecial - copy special section from source page

[HACKERS] unnecessary code in_bt_split

2008-08-03 Thread Zdenek Kotala
I found that _bt_split function calls PageGetTempPage, but next call is _bt_page_init which clear all contents anyway. Is there any reason to call PageGetTempPage instead of palloc? Original code: 00796 leftpage = PageGetTempPage(origpage, sizeof(BTPageOpaqueData)); 00797 rightpage =

Re: [HACKERS] unnecessary code in_bt_split

2008-08-03 Thread Tom Lane
Zdenek Kotala [EMAIL PROTECTED] writes: I found that _bt_split function calls PageGetTempPage, but next call is _bt_page_init which clear all contents anyway. Is there any reason to call PageGetTempPage instead of palloc? Not violating a perfectly good abstraction? I agree that