Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 211d80c

Browse filesBrowse 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
Copy full SHA for 211d80c

File tree

1 file changed

+4
-3
lines changed
Filter options

1 file changed

+4
-3
lines changed

‎contrib/postgres_fdw/postgres_fdw.c

Copy file name to clipboardExpand all lines: contrib/postgres_fdw/postgres_fdw.c
+4-3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.