-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cache the hash map in SubscriptUtil if a single map is reused with co…
…mplex keys (#10414) Summary: Pull Request resolved: #10414 Today in SubscriptUtil, if the map passed in has primitive keys and the same MapVector is passed in multiple times, we cache the hash maps for optimized lookups across batches. If the map has complex keys, and base MapVector has a single value, we construct a local hash map to optimize the lookups within a batch. This change merges the two approaches for maps with Complex keys, so if we see the same Vector passed in multiple times where the base MapVector has a single value, we cache the hash map so we don't need to reconstruct it for every batch. In some cases we've seen this can significantly speed up Presto queries, particularly because the cost of hashing complex types to construct the hash map can be fairly high. We could go a step further and, like for maps with primitive keys, cache maps with complex keys regardless of the number of values in the base MapVector, but I haven't seen any cases that would benefit from this yet so I'm not sure what the tradeoffs in terms of memory and construction cost would look like, so extending the original optimizations seems like a good starting point. Differential Revision: D59474490
- Loading branch information
1 parent
94763e7
commit 4676df5
Showing
5 changed files
with
275 additions
and
69 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
Oops, something went wrong.