WIP: Page space reservation (pgupgrade)

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: WIP: Page space reservation (pgupgrade)
Date: 2008-11-08 22:59:30
Message-ID: 491619D2.2090602@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Attached patch allows to setup storage parameter for space reservation. I use
reloptions capability for it. You can use it:

CREATE TABLE test(id int) with (reservedspace=10);

The idea is to reduce freespace value about reservedspace on places where
PageGet(Heap)FreeSpace is called.

I need perform more tests on this patch, however I need feedback if it is
reasonable way. It seems to me that the patch could be backported without any
problem.

I have still following doubts/questions:

1) GiST - gist uses gistnospace() function to check correct amount of space.
unfortunately, it does not have information about Relation. The function is
called from:

gistContinueInsert(), gistplacetopage(), and gistVacuumUpdate().

It seems to me that better that modify this function should be modified these
callers (exclude gistContinueInsert see 2)

2) WAL - I do not modify freespace during WAL replay. I think that when
reservedspace is set, then WAL record cannot break a space reservation.

3) vacuum - PageGetFreeSpaceWithFillFactor

It look likes that vacuum uses fill factor to check possible free space on page,
but it does not try to free space on page to satisfy fill factor criteria. Is it
correct or I'm wrong?

Thanks for your comments.
Zdenek

--
Zdenek Kotala Sun Microsystems
Prague, Czech Republic http://sun.com/postgresql

Attachment Content-Type Size
reservedspace.patch text/x-diff 18.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chuck McDevitt 2008-11-09 00:24:37 Re: Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle
Previous Message Jonah H. Harris 2008-11-08 22:12:58 Re: [PATCH] Recreate Missing WAL Directories (from TODO)