Skip to content

Commit

Permalink
opt: revert data race fix
Browse files Browse the repository at this point in the history
This commit reverts #37972. We no longer lazily build filter props and
share them across multiple threads.

Release note: None
  • Loading branch information
mgartner committed Jul 29, 2022
1 parent 7e2df69 commit d9469de
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/sql/opt/memo/logical_props_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1497,13 +1497,9 @@ func (b *logicalPropsBuilder) buildFiltersItemProps(item *FiltersItem, scalar *p
// Constraints
// -----------
cb := constraintsBuilder{md: b.mem.Metadata(), evalCtx: b.evalCtx}
// TODO(rytaft): Using local variables here to avoid a data race. It would be
// better to avoid lazy building of props altogether.
constraints, tightConstraints := cb.buildConstraints(item.Condition)
if constraints.IsUnconstrained() {
scalar.Constraints, scalar.TightConstraints = cb.buildConstraints(item.Condition)
if scalar.Constraints.IsUnconstrained() {
scalar.Constraints, scalar.TightConstraints = nil, false
} else {
scalar.Constraints, scalar.TightConstraints = constraints, tightConstraints
}

// Functional Dependencies
Expand Down

0 comments on commit d9469de

Please sign in to comment.