Skip to content

Commit

Permalink
opt,sqltelemetry: added a counter for OrderByNullsStandardCounter
Browse files Browse the repository at this point in the history
Prior to this commit, we only had a counter for uses of non-standard
NULLs ordering. This commit adds a counter for standard NULLs ordering
so we can compare the two.

Release note: None
  • Loading branch information
rytaft committed Dec 13, 2022
1 parent b10363d commit e75b446
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/sql/opt/optbuilder/orderby.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ func (b *Builder) hasDefaultNullsOrder(order *tree.Order) bool {
telemetry.Inc(sqltelemetry.OrderByNullsNonStandardCounter)
return false
}
telemetry.Inc(sqltelemetry.OrderByNullsStandardCounter)
return true
}

Expand Down
5 changes: 5 additions & 0 deletions pkg/sql/sqltelemetry/planning.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ var CreateStatisticsUseCounter = telemetry.GetCounterOnce("sql.plan.stats.create
// FIRST).
var OrderByNullsNonStandardCounter = telemetry.GetCounterOnce("sql.plan.opt.order-by-nulls-non-standard")

// OrderByNullsStandardCounter is to be incremented whenever a standard
// ordering of nulls is used for ORDER BY (either ASC NULLS FIRST or DESC NULLS
// LAST).
var OrderByNullsStandardCounter = telemetry.GetCounterOnce("sql.plan.opt.order-by-nulls-standard")

// TurnAutoStatsOnUseCounter is to be incremented whenever automatic stats
// collection is explicitly enabled.
var TurnAutoStatsOnUseCounter = telemetry.GetCounterOnce("sql.plan.automatic-stats.enabled")
Expand Down

0 comments on commit e75b446

Please sign in to comment.