@@ -2314,68 +2314,6 @@ ReadMultiXactCounts(uint64 *multixacts, MultiXactOffset *members)
2314
2314
return true;
2315
2315
}
2316
2316
2317
- /*
2318
- * Multixact members can be removed once the multixacts that refer to them
2319
- * are older than every datminxmid. autovacuum_multixact_freeze_max_age and
2320
- * vacuum_multixact_freeze_table_age work together to make sure we never have
2321
- * too many multixacts; we hope that, at least under normal circumstances,
2322
- * this will also be sufficient to keep us from using too many offsets.
2323
- * However, if the average multixact has many members, we might exhaust the
2324
- * members space while still using few enough members that these limits fail
2325
- * to trigger full table scans for relminmxid advancement. At that point,
2326
- * we'd have no choice but to start failing multixact-creating operations
2327
- * with an error.
2328
- *
2329
- * To prevent that, if more than a threshold portion of the members space is
2330
- * used, we effectively reduce autovacuum_multixact_freeze_max_age and
2331
- * to a value just less than the number of multixacts in use. We hope that
2332
- * this will quickly trigger autovacuuming on the table or tables with the
2333
- * oldest relminmxid, thus allowing datminmxid values to advance and removing
2334
- * some members.
2335
- *
2336
- * As the fraction of the member space currently in use grows, we become
2337
- * more aggressive in clamping this value. That not only causes autovacuum
2338
- * to ramp up, but also makes any manual vacuums the user issues more
2339
- * aggressive. This happens because vacuum_set_xid_limits() clamps the
2340
- * freeze table and the minimum freeze age based on the effective
2341
- * autovacuum_multixact_freeze_max_age this function returns. In the worst
2342
- * case, we'll claim the freeze_max_age to zero, and every vacuum of any
2343
- * table will try to freeze every multixact.
2344
- *
2345
- * It's possible that these thresholds should be user-tunable, but for now
2346
- * we keep it simple.
2347
- */
2348
- int64
2349
- MultiXactMemberFreezeThreshold (void )
2350
- {
2351
- MultiXactOffset members ;
2352
- uint64 multixacts ;
2353
- uint64 victim_multixacts ;
2354
- double fraction ;
2355
-
2356
- /* If we can't determine member space utilization, assume the worst. */
2357
- if (!ReadMultiXactCounts (& multixacts , & members ))
2358
- return 0 ;
2359
-
2360
- /* If member space utilization is low, no special action is required. */
2361
- if (members <= MULTIXACT_MEMBER_SAFE_THRESHOLD )
2362
- return autovacuum_multixact_freeze_max_age ;
2363
-
2364
- /*
2365
- * Compute a target for relminmxid advancement. The number of multixacts
2366
- * we try to eliminate from the system is based on how far we are past
2367
- * MULTIXACT_MEMBER_SAFE_THRESHOLD.
2368
- */
2369
- fraction = (double ) (members - MULTIXACT_MEMBER_SAFE_THRESHOLD ) /
2370
- (MULTIXACT_MEMBER_DANGER_THRESHOLD - MULTIXACT_MEMBER_SAFE_THRESHOLD );
2371
- victim_multixacts = multixacts * fraction ;
2372
-
2373
- /* fraction could be > 1.0, but lowest possible freeze age is zero */
2374
- if (victim_multixacts > multixacts )
2375
- return 0 ;
2376
- return multixacts - victim_multixacts ;
2377
- }
2378
-
2379
2317
typedef struct mxtruncinfo
2380
2318
{
2381
2319
int earliestExistingPage ;
0 commit comments