Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/statistics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ go_test(
data = glob(["testdata/**"]),
embed = [":statistics"],
flaky = True,
shard_count = 44,
shard_count = 45,
deps = [
"//pkg/config",
"//pkg/meta/model",
Expand Down
2 changes: 2 additions & 0 deletions pkg/statistics/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ const (
DefaultTopNValue = 100
// DefaultHistogramBuckets is the default number of histogram buckets
DefaultHistogramBuckets = 256
// NDVSampleSkipRate is the sample rate at which sampling is skipped, so NDV sketches are built from every row.
NDVSampleSkipRate = 1
Comment on lines +23 to +24
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we just call it DefaultNDVSampleRate?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// NDVSampleSkipRate is the sample rate at which sampling is skipped, so NDV sketches are built from every row.
NDVSampleSkipRate = 1
// NDVSampleSkipRate is the sample rate at which sampling is skipped. The default value is 1, so NDV sketches are built from every row.
NDVSampleSkipRate = 1

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DefaultNDVSampleRate would be used when we integrate it with the priority queue. Then its default value would be 0.05, I guess. This is the value we use to skip sampling by default.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or otherwise, we would end up with two defaults:

DefaultNDVSampleRate for normal tables as 1.

DefaultNDVSampleRateForBigTable for big tables as 0.05??

)
Loading
Loading