Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
114623: opt: reduce planning time for queries with many joins r=mgartner a=mgartner #### opt: move slow-query benchmark schemas to SQL file This commit moves the schemas used for slow-query benchmarks into a separate SQL file so that the schemas can continue to grow without making a mess of `bench_test.go`. Release note: None #### opt: add slow-query-6 Release note: None #### opt: add two reorder_join_limit cases for BenchmarkSlowQueries `BenchmarkSlowQueries` now runs each slow query benchmark with `reorder_join_limit` set to `0` and `8`. This will allow us to analyze the range of query optimization performance with respect to this setting which is commonly adjusted to reduce planning latency. Release note: None #### opt: avoid FuncDepSet.tryToReduceKey in FuncDepSet.addEquivalency Prior to this commit, `FuncDepSet.tryToReduceKey` was called at the end of `FuncDepSet.addEquivalency`. This was inefficient because `FuncDepSet.AddFrom` and `FuncDepSet.AddEquivFrom` can call `addEquivalency` multiple times, and the FD's key only needs to be reduced after all equivalencies and dependencies have been added. Now, `tryToReduceKey` is no longer called in `addEquivalency` and callers are responsible for ensuring that it is called. This mimics the behavior of the similar function `addDependency`. Release note: None #### opt: add `FuncDepSet.addConstantsNoKeyReduction` This commit adds a new method `FuncDepSet.addConstantsNoKeyReduction` which is the same as `FuncDepSet.AddConstants`, only differing because it not attempt to reduce the key like `AddConstants does. This allows us to avoid key-reducing computation in a few places. Release note: None #### opt: use `ComputeEquivClosureNoCopy` in `FuncDepSet.addEquivalency` This commit changes the invocation of `ComputeEquivClosure` within `FuncDepSet.addEquivalency` to `ComputeEquivClosureNoCopy`. This is valid because `addEquivalency` is only called with sets that have already been copied, so mutating the input set is safe. Release note: None #### opt: avoid ColSet allocations in statisticsBuilder.colStatJoin This commit reduces allocation in `statisticsBuilder.colStatJoin`. Previously, it was creating intersections of two sets, which, in some cases, were only useful for checking their emptiness. Now we use the `ColSet.Intersects` method which returns a boolean and does not build a new set. Release note: None #### opt: reduce allocations in statistic builder This commit reduces allocations in the statistics builder by avoiding creating singleton column sets. A new `ColStatsMap.LookupSingleton` method allows columns stats for a single column to be fetched without building a column set and potentially allocating memory. Epic: None Release note: None Co-authored-by: Marcus Gartner <[email protected]>
- Loading branch information