Skip to content
Snippets Groups Projects
Verified Commit 214b55a5 authored by Denis Smirnov's avatar Denis Smirnov
Browse files

feat!: dispatch IR instead of the SQL with parameters

BREAKING CHANGE: api functions have changed signatures.

This commit changes the way how the router dispatches commands to
the storages. Previously, the router compiled the SQL statements
with parameters from the plan subtrees and sent them to the storages.

Now the router sends the raw IR subtrees to the storages.

1. The subtrees are constructed from the original plan nodes
   for performance reasons: the node's memory chunk is extracted
   from the original plan tree (replaced with invalid parameter node)
   and reused in the sub-plan.
2. The router-storage message consists of the two parts: required and
   optional. The required part is the hash of the sub-plan (excluding
   constants - analogue of the SQL pattern in the previous version)
   and parameters. The optional part is the IR itself and the syntax
   node tree (precompiled on the router to skip redundant work on the
   multiple storages). Storage uses a lazy deserialization of the message:
   - first it deserialized the part with the hash and parameters (to
     check the plan cache)
   - if the cache lookup failed, it deserializes the IR and the syntax
     node tree and updates the cache.
3. The SHA256 hash was replaced with BLAKE3 for performance reasons.
parent bd91b9b7
No related branches found
No related tags found
1 merge request!1414sbroad import
Showing
with 1329 additions and 2228 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment