Re: FSM search modes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: FSM search modes
Date
Msg-id 3969.1254430079@sss.pgh.pa.us
Whole thread Raw
In response to Re: FSM search modes  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: FSM search modes
Re: FSM search modes
List pgsql-hackers
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> The way I figure it, if there is a 0.01 chance to reset the sweep,
> then there's a 0.99 percent chance to continue the sweep from the last
> position.  0.99^229 is about 0.1, which means there is a 10% chance
> not to have reset after that many attempts to advance.

Right, so the odds would be that a backend will confine its insertion
attempts to the first 229 pages containing a usable amount of free
space.  As long as the number of backends concurrently inserting
into the relation is well under 229, this seems perfectly fine.
(Hm, so we might want to make the probability depend on
max_connections?)

A possible downside of keeping things compact this way is that you'd
probably get a longer average search distance because of all the early
pages tending to remain full.  Maybe what we want is some bias against
inserting in the last half or quarter of the table, or some such rule,
rather than necessarily heading for the start of the relation.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: FSM search modes
Next
From: Bernd Helmle
Date:
Subject: Re: TODO item: Allow more complex user/database default GUC settings