Skip to content

Commit

Permalink
sql: disable histogram usage for internal executor
Browse files Browse the repository at this point in the history
Since cockroachdb#101486, the internal executor has used global defaults for
session settings. This effectively enabled `optimizer_use_histograms`
for the internal executor, which was disabled before. This caused a
huge performance regression. The root cause of the regression is not yet
understood. This commit disables `optimizer_use_histograms` as a
temporary solution for the performance regression.

Informs cockroachdb#102954

Release note: None
  • Loading branch information
mgartner committed Jun 6, 2023
1 parent 45aab9d commit 6c1cca4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/sql/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ func NewInternalSessionData(

sdMutIterator.applyOnEachMutator(func(m sessionDataMutator) {
for varName, v := range varGen {
if varName == "optimizer_use_histograms" {
// Do not use histograms when optimizing internal executor
// queries. This causes a significant performance regression.
// TODO(#102954): Diagnose and fix this.
continue
}
if v.Set != nil {
hasDefault, defVal := getSessionVarDefaultString(varName, v, m.sessionDataMutatorBase)
if hasDefault {
Expand Down

0 comments on commit 6c1cca4

Please sign in to comment.