Permalink
Browse files

Fix of the sampling (was missing one percent of the queries).

  • Loading branch information...
tvondra committed Oct 30, 2011
1 parent 80fafad commit 83af8a8ae361f541e1dc96790071a41e72980419
Showing with 1 addition and 1 deletion.
  1. +1 −1 queryhist.c
View
@@ -285,7 +285,7 @@ explain_ExecutorEnd(QueryDesc *queryDesc)
seconds = queryDesc->totaltime->total;
/* N % 100 returns value 0-99, so we need to subtract 1 from the sample_pct */
- if ((histogram_initialized) && (rand() % 100 < (default_histogram_sample_pct-1))) {
+ if ((histogram_initialized) && (rand() % 100 < default_histogram_sample_pct)) {
query_hist_add_query(seconds);
}

0 comments on commit 83af8a8

Please sign in to comment.