Merged PRs
dolt
- 2188: merge optimizations
go-mysql-server
- 568: sql/analyzer: indexed_joins: Keep searching for usable indexes when there are NOT(? = ?) and NOT(? <=> ?) clauses in a join conjunction.
The indexed join logic is perfectly happy to go forward with a join plan if it
doesn't find a perfect index, or even a usable index at all, for one or more
table factors in the join. This logic is probably left over from when that was
not the case, but for now we make it a little more liberal to cover some cases
we need to cover for a customer. - 567: sql/plan,analyzer: Fix HashLookup for cases where there is a schema prefix not visible to the direct join parent.
This adds aTransformUpCtx
function that passes along aSchemaPrefix
in theTransformContext
if the schema prefix is scrutable from resolved children at that point in the analysis.apply_hash_lookup
makes use of this to make the transformed expressions in theHashLookup
lookup node refer to the right place, even whenJoinNode.Left().Schema()
doesn't have the whole prefix.
This schema prefix is probably useful in other places and I am exploring rationalizing certain places where the analyzer makes use of the schema by using it or something like it.
In the mean time, converted some of the more obscure transform variants (UpWithParent, UpWithSelector) to use TransformUpCtx as well. Held off on moving TransformUp to TransformUpCtx.
Very open to suggestions on names for TransformUpCtx. - 566: sql/analyzer: Make SubqueryAlias nodes always cacheable.
- 565: sql: Removing ctx parameter from Expression.WithChildren.
Also removes it from FunctionFn types, TransformExpression... functions, and Aggregation.NewBuffer.
We think thisctx
parameter might have been added a few months ago as part of some optimization work which never made it across the line. Instead of threading a*sql.Context
everywhere, if we have need of a*sql.Context
during analysis or to precompute or materialize a certain result in the future, I think I'm going to advocate for a specific optional interface that the analyzer is aware of. It could then pass the context through at a specific analyzer phase and the function/expression node would have the opportunity to get ready to do what it needs to.
Closed Issues
- 569: Outdated example