New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: humanize counts and durations in EXPLAIN ANALYZE #57420
Conversation
0f590c1
to
37398fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 47 of 47 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @asubiotto and @RaduBerinde)
pkg/sql/execinfrapb/component_stats.go, line 57 at r1 (raw file):
} if s.NetRx.TuplesReceived.HasValue() { fn("network tuples received", humanize.Comma(int64(s.NetRx.TuplesReceived.Value())))
[nit] what do you think about adding a function humanizeutil.Count
that calls humanize.Comma
? That would be more consistent with humanizeutil.Duration
.
pkg/util/humanizeutil/duration_test.go, line 25 at r1 (raw file):
{val: 0, exp: "0µs"}, {val: 12, exp: "0µs"}, {val: 1234, exp: "1µs"},
What about checking that 501 rounds up to 1 microsecond?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TFTR!
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @asubiotto and @rytaft)
pkg/sql/execinfrapb/component_stats.go, line 57 at r1 (raw file):
Previously, rytaft (Rebecca Taft) wrote…
[nit] what do you think about adding a function
humanizeutil.Count
that callshumanize.Comma
? That would be more consistent withhumanizeutil.Duration
.
Done.
pkg/util/humanizeutil/duration_test.go, line 25 at r1 (raw file):
Previously, rytaft (Rebecca Taft) wrote…
What about checking that 501 rounds up to 1 microsecond?
Done.
54cdfa8
to
5658763
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 8 of 8 files at r2.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @asubiotto and @RaduBerinde)
pkg/util/humanizeutil/count.go, line 15 at r2 (raw file):
import "github.com/dustin/go-humanize" // Count formats a unitless iteger value like a row count. It uses separating
[nit] iteger -> integer
This change humanizes all statistics showed in EXPLAIN and EXPLAIN ANALYZE (both the text and the diagram): - byte values were already humanized - row counts are shown with commas (e.g. 1,000,000); - durations are rounded out in a more friendly way. Most importantly, we no longer show a lot of decimals for multi-second times, and the zero value is now shown as "0µs" instead of "0s" (the latter can be confusing, e.g. is it hiding a 100ms time?). Release note (sql change): EXPLAIN and EXPLAIN ANALYZE now show counts and durations in a more user-friendly way.
5658763
to
a1a86c4
Compare
bors r+ |
Build succeeded: |
This change humanizes all statistics showed in EXPLAIN and EXPLAIN
ANALYZE (both the text and the diagram):
we no longer show a lot of decimals for multi-second times, and the
zero value is now shown as "0µs" instead of "0s" (the latter can be
confusing, e.g. is it hiding a 100ms time?).
Release note (sql change): EXPLAIN and EXPLAIN ANALYZE now show counts
and durations in a more user-friendly way.