Re: FSM search modes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: FSM search modes
Date
Msg-id 21044.1254416103@sss.pgh.pa.us
Whole thread Raw
In response to Re: FSM search modes  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: FSM search modes
List pgsql-hackers
Simon Riggs <simon@2ndQuadrant.com> writes:
> Yes, as Tom points out, this must be done with bias away from the very
> end of the table.

> I meant that we should start from the beginning of large spaces and that
> we shouldn't assume that all space worth filling is at start of
> relation.

Right.  One of the goals that FSM is trying to meet is ensuring that
different backends aren't trying to insert into the same page
concurrently, so as to reduce page-level contention.  So for example
it'd be a bad idea to adopt the really-dumb strategy of searching from
the start of the table for each request --- it'd funnel all the backends
to the same target page.  What we want is a behavior that is randomized
but tends to prefer pages towards the start rather than hitting all free
pages equally.  The btree precedent makes me suspect that quite a weak
preference would be sufficient.  So for example we might try resetting
the search to the start of the relation with probability 0.01.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Euler Taveira de Oliveira
Date:
Subject: Re: Limit allocated memory per session
Next
From: Magnus Hagander
Date:
Subject: Re: Rejecting weak passwords