Re: unnecessary code in_bt_split

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: unnecessary code in_bt_split
Date: 2008-08-04 09:23:03
Message-ID: 4896CA77.7070909@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane napsal(a):
> Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2008-08-04 09:53:13 Re: Mini improvement: statement_cost_limit
Previous Message daveg 2008-08-04 07:50:40 Re: Mini improvement: statement_cost_limit