-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
62893: opt: fix geospatial function NULL argument panics r=mgartner a=mgartner This commit fixes panics that occurred when planning inverted index scans and when performing inverted joins on `GEOMETRY` and `GEOGRAPHY` inverted indexes for queries containing geospatial functions with an `NULL` constant argument. This panic only occurred when the constant `NULL` argument was cast to an acceptable type for the function overload, for example `ST_DWithin(a, b, NULL::FLOAT8)` or `ST_DWithin(NULL:GEOMETRY, b, 1)`. Without the cast, no panic occured because `tree.FuncExpr.TypeCheck` rewrites a `tree.FuncExpr` as `tree.DNull` when any of the arguments have an unknown type, such as an uncast `NULL`. This rewriting happens even before the `tree.FuncExpr` is built into a `memo.FunctionExpr` by optbuilder. Fixes #60527 Fixes #62686 Release note (bug fix): Queries that reference tables with `GEOMETRY` or `GEOGRAPHY` inverted indexes and that call geospatial functions with constant `NULL` values cast to a type, like `NULL::GEOMETRY` or `NULL::FLOAT8`, no longer error. This bug was present since 20.2. 62984: storage: reduce memory allocations in intentInterleavingIter r=sumeerbhola a=sumeerbhola The memory allocations for computing the bounds for the EngineIterator were 33% of the memory allocations in batcheval.Scan in a joinReader benchmark (the rest, as expected, is in pebbleResults for storing the result of the scan). These allocations were 6% of the cpu in MVCCScanToBytes in the same benchmark. Release note: None Co-authored-by: Marcus Gartner <[email protected]> Co-authored-by: sumeerbhola <[email protected]>
- Loading branch information
Showing
4 changed files
with
95 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters