[HACKERS] Where is the decision about placement of new tuple made ?

2005-07-12 Thread Hannu Krosing
Where in the source is the decision about the placement new tuple (on which page to put it) made ? 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

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

2005-07-12 Thread Alvaro Herrera
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

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

2005-07-12 Thread Tom Lane
Hannu Krosing [EMAIL PROTECTED] 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

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

2005-07-12 Thread Jim C. Nasby
If you're going to do this I would suggest keeping in mind that a similar tactic could be used to help keep a table clustered (I think there may even be a TODO on that). The basic idea there is to use the clustering index to decide the best page to put a tuple on and try and return that page (or