Re: Free Space Map thoughts - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Free Space Map thoughts
Date
Msg-id 47342718.5060701@enterprisedb.com
Whole thread Raw
In response to Re: Free Space Map thoughts  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Free Space Map thoughts  (Simon Riggs <simon@2ndquadrant.com>)
Re: Free Space Map thoughts  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera wrote:
> Simon Riggs wrote:
>> Presumably we would not store an FSM for small tables? On the basis that
>> the purpose of the FSM is to save on pointless I/O there must be a size
>> of table below which an FSM is just overhead.
> 
> Hmm, do you mean that we would open and verify every page of a small
> relation until we find one with free space?  That doesn't sound very
> good.

There is a threshold somewhere. If the heap consists of just one page, 
clearly the FSM doesn't give any benefit. If it's two pages, it's 
probably still faster to just check the two pages. Somewhere after that 
the FSM starts to pay off.

Whether the overhead is big enough that we care to optimize by not 
having the FSM for tiny tables, I don't know. Probably not. If the FSM 
is stored in the heap file, it's tricky to add the FSM after the fact. 
If it's a separate file, creating the FSM requires catalog changes.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: [PERFORM] Estimation problem with a LIKE clause containing a /
Next
From: Simon Riggs
Date:
Subject: Re: Free Space Map thoughts