Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit803cdf2

Browse files
committed
Update reference to sampling algorithm in analyze.c
Commit83e176e moved row sampling functions from analyze.c toutils/misc/sampling.c, but failed to update comment referring tothe sampling algorithm from Jeff Vitter's paper. Correct thecomment by pointing to utils/misc/sampling.c.Author: Etsuro FujitaDiscussion:https://postgr.es/m/CAPmGK154gp%2BQd%3DcorQOv%2BPmbyVyZBjp_%2Bhb766UJeD1e_ie6XQ%40mail.gmail.com
1 parente4f2d4f commit803cdf2

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
@@ -1207,13 +1207,13 @@ acquire_sample_rows(Relation onerel, int elevel,
12071207
* The first targrows sample rows are simply copied into the
12081208
* reservoir. Then we start replacing tuples in the sample
12091209
* until we reach the end of the relation. This algorithm is
1210-
* from Jeff Vitter's paper (see full citationbelow). It
1211-
* works by repeatedly computing the number of tuples to skip
1212-
*before selecting a tuple, which replaces a randomly chosen
1213-
*element of the reservoir (current set oftuples). At all
1214-
*times the reservoir is a true random sample ofthetuples
1215-
* we've passed over so far, so when we fall off the end of
1216-
* the relation we're done.
1210+
* from Jeff Vitter's paper (see full citationin
1211+
*utils/misc/sampling.c). Itworks by repeatedly computing
1212+
*the number of tuples to skip before selecting a tuple,
1213+
*which replaces a randomly chosen element ofthe reservoir
1214+
*(current set of tuples). At all timesthereservoir is a
1215+
*true random sample of the tupleswe've passed over so far,
1216+
*so when we fall off the end ofthe relation we're done.
12171217
*/
12181218
if (numrows<targrows)
12191219
rows[numrows++]=heap_copytuple(&targtuple);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp