1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-05 23:56:58 +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:
Tomas Vondra 2023-01-06 14:47:02 +01:00
parent 4037c5e2fe
commit 211d80c065

View File

@ -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);
} }
} }