Tom Lane <t...@sss.pgh.pa.us> wrote: > "Kevin Grittner" <kevin.gritt...@wicourts.gov> writes: >> [pages with free space or total pages in relation?] > > It's going to be the latter --- we do not know, and are *not* going > to invest the cycles to find out, how many pages have a useful > amount of free space. Even finding out the relation physical length > might be more cycles than we want to spend here ... OK, after mulling this over for a while, I suspect we'd do pretty well with starting to consider resetting the sweep after hitting 50% of the last known relation size (or whatever best approximation is available at low cost), and using a reset probability of 1 / (max_connections * 4). That gives about a 77.8% chance of getting to at least max_connections before resetting the sweep. Since it leaves about an 8.2% chance of getting to at least ten times max_connections pages before resetting the sweep, I'm inclined to think we'd want to start that at 50% of the relation rather than waiting until we get to the last quarter. As one more data point to consider, if someone has 2000 connections configured (which I've seen mentioned in many posts), you would get to 50,000 pages past the point where you start using this technique one time out of 500. -Kevin
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers