Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 69fd82f

Browse files
committed
Update reference to sampling algorithm in analyze.c
Commit 83e176e moved row sampling functions from analyze.c to utils/misc/sampling.c, but failed to update comment referring to the sampling algorithm from Jeff Vitter's paper. Correct the comment by pointing to utils/misc/sampling.c. Author: Etsuro Fujita Discussion: https://postgr.es/m/CAPmGK154gp%2BQd%3DcorQOv%2BPmbyVyZBjp_%2Bhb766UJeD1e_ie6XQ%40mail.gmail.com
1 parent 050098b commit 69fd82f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/backend/commands/analyze.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,13 +1048,13 @@ acquire_sample_rows(Relation onerel, int elevel,
10481048
* The first targrows sample rows are simply copied into the
10491049
* reservoir. Then we start replacing tuples in the sample until
10501050
* we reach the end of the relation. This algorithm is from Jeff
1051-
* Vitter's paper (see full citation below). It works by
1052-
* repeatedly computing the number of tuples to skip before
1053-
* selecting a tuple, which replaces a randomly chosen element of
1054-
* the reservoir (current set of tuples). At all times the
1055-
* reservoir is a true random sample of the tuples we've passed
1056-
* over so far, so when we fall off the end of the relation we're
1057-
* done.
1051+
* Vitter's paper (see full citation in utils/misc/sampling.c). It
1052+
* works by repeatedly computing the number of tuples to skip
1053+
* before selecting a tuple, which replaces a randomly chosen
1054+
* element of the reservoir (current set of tuples). At all times
1055+
* the reservoir is a true random sample of the tuples we've
1056+
* passed over so far, so when we fall off the end of the relation
1057+
* we're done.
10581058
*/
10591059
if (numrows < targrows)
10601060
rows[numrows++] = ExecCopySlotHeapTuple(slot);

0 commit comments

Comments
 (0)