-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add next-item query based on a join (#6551)
- Adds the `NextItemSelfJoined` query, which implements the next-item query as a self-join. The current implementation joins the target table with the series of all possible values for the target item. Because CRDB eagerly evaluates subqueries, this entire list must be buffered in memory. The self-join version instead joins the existing table with the literal next item (item + 1), and finds the lowest one that's not allocated yet. Some initial testing suggests this can consume much less memory and run much faster than the previous query implementations. As a tradeoff, this new query cannot be used to randomly select _any_ item in a range -- only the next, lowest value can be selected. Note that this changes the way we allocate MAC addresses, which were previously random. - Fixes #5904
- Loading branch information
Showing
2 changed files
with
629 additions
and
144 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
Oops, something went wrong.