Re: unnecessary code in_bt_split

Поиск
Список
Период
Сортировка
От Zdenek Kotala
Тема Re: unnecessary code in_bt_split
Дата
Msg-id 4896CA77.7070909@sun.com
обсуждение исходный текст
Ответ на Re: unnecessary code in_bt_split  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: unnecessary code in_bt_split  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane napsal(a):
> Zdenek Kotala <Zdenek.Kotala@Sun.COM> 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. Abstraction is nice, but what I see in the PageGetTempPage It is more like 
code which makes everything but usability is zero. It is used only in two places 
and in both it is used for different purpose. _bt_split() needs only allocate 
empty temp page and gistplacetopage() .

 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
PageRestoreTempPage - no change.

    Zdenek




В списке pgsql-hackers по дате отправления:

Предыдущее
От: daveg
Дата:
Сообщение: Re: Mini improvement: statement_cost_limit
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: Mini improvement: statement_cost_limit