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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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 14:26:51
Message-ID: 19044.1121178411@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hannu Krosing <hannu(at)skype(dot)net> writes:
> Where in the source is the decision about the placement new tuple (on
> which page to put it) made ?

RelationGetBufferForTuple() and the free space map
src/backend/access/heap/hio.c
src/backend/storage/freespace/freespace.c

> 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,

I have strong doubts about this idea. The existing policy is designed
to reduce contention by having different backends inserting into
different pages.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-07-12 14:48:40 Re: [PATCHES] thousands comma numeric formatting in psql
Previous Message Alvaro Herrera 2005-07-12 13:53:11 Re: Where is the decision about placement of new tuple made ?