mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Fix stale comment about sample_frac adjustment
A comment was left behind referencing sample rate adjustment removed
from 8ad51b5f44
. So clean that up. While at it also remove the sample
rate clamping which should not be necessary without the clamping, and
just check that with an assert.
Reported-by: Tom Lane
Discussion: https://postgr.es/m/951485.1672461744%40sss.pgh.pa.us
This commit is contained in:
@ -5204,10 +5204,11 @@ postgresAcquireSampleRowsFunc(Relation relation, int elevel,
|
|||||||
sample_frac = targrows / reltuples;
|
sample_frac = targrows / reltuples;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ensure the sampling rate is between 0.0 and 1.0, even after the
|
* We should never get sampling rate outside the valid range
|
||||||
* 10% adjustment above. (Clamping to 0.0 is just paranoia.)
|
* (between 0.0 and 1.0), because those cases should be covered
|
||||||
|
* by the previous branch that sets ANALYZE_SAMPLE_OFF.
|
||||||
*/
|
*/
|
||||||
sample_frac = Min(1.0, Max(0.0, sample_frac));
|
Assert(sample_frac >= 0.0 && sample_frac <= 1.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user