Skip to content

Commit 211d80c

Browse files
committed
Fix stale comment about sample_frac adjustment
A comment was left behind referencing sample rate adjustment removed from 8ad51b5. 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
1 parent 4037c5e commit 211d80c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

contrib/postgres_fdw/postgres_fdw.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5204,10 +5204,11 @@ postgresAcquireSampleRowsFunc(Relation relation, int elevel,
52045204
sample_frac = targrows / reltuples;
52055205

52065206
/*
5207-
* Ensure the sampling rate is between 0.0 and 1.0, even after the
5208-
* 10% adjustment above. (Clamping to 0.0 is just paranoia.)
5207+
* We should never get sampling rate outside the valid range
5208+
* (between 0.0 and 1.0), because those cases should be covered
5209+
* by the previous branch that sets ANALYZE_SAMPLE_OFF.
52095210
*/
5210-
sample_frac = Min(1.0, Max(0.0, sample_frac));
5211+
Assert(sample_frac >= 0.0 && sample_frac <= 1.0);
52115212
}
52125213
}
52135214

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy