Re: Where is the decision about placement of new tuple made ?

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Hannu Krosing <hannu(at)skype(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Where is the decision about placement of new tuple made ?
Date: 2005-07-12 13:53:11
Message-ID: 20050712135311.GA9597@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 12, 2005 at 04:30:04PM +0300, Hannu Krosing wrote:

> Where in the source is the decision about the placement new tuple (on
> which page to put it) made ?

heap_insert and heap_update. They get a page with free space from the
FSM, or extend the relation, or --in heap_update case-- try to use the
same page.

> I'd like to take a look at adding "gravity" to that decision, do that I
> can make postgres to decide to place new tuple (inserted or updated)
> near the beginning of file, in order to make it possible for ordinary
> (lazy) vacuum to shrink relations more often, initially controlled by
> GUC, maybe later by some other, more automatic hints, like % of empty
> pages.

You'll have to modify the FSM code, I guess.

--
Alvaro Herrera (<alvherre[a]alvh.no-ip.org>)
"Ni aun el genio muy grande llegaría muy lejos
si tuviera que sacarlo todo de su propio interior" (Goethe)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-07-12 14:26:51 Re: Where is the decision about placement of new tuple made ?
Previous Message Devrim GUNDUZ 2005-07-12 13:30:48 New dot releases?