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.
Showing
- .gitlab-ci.yml 1 addition, 1 deletion.gitlab-ci.yml
- Cargo.lock 176 additions, 126 deletionsCargo.lock
- ci/Dockerfile 2 additions, 2 deletionsci/Dockerfile
- sbroad-cartridge/Cargo.toml 4 additions, 0 deletionssbroad-cartridge/Cargo.toml
- sbroad-cartridge/src/api/calculate_bucket_id.rs 18 additions, 12 deletionssbroad-cartridge/src/api/calculate_bucket_id.rs
- sbroad-cartridge/src/api/exec_query.rs 102 additions, 109 deletionssbroad-cartridge/src/api/exec_query.rs
- sbroad-cartridge/src/api/exec_query/protocol.rs 294 additions, 0 deletionssbroad-cartridge/src/api/exec_query/protocol.rs
- sbroad-cartridge/src/api/helper.rs 2 additions, 2 deletionssbroad-cartridge/src/api/helper.rs
- sbroad-cartridge/src/cartridge.rs 1 addition, 1 deletionsbroad-cartridge/src/cartridge.rs
- sbroad-cartridge/src/cartridge/config.rs 59 additions, 66 deletionssbroad-cartridge/src/cartridge/config.rs
- sbroad-cartridge/src/cartridge/router.rs 168 additions, 99 deletionssbroad-cartridge/src/cartridge/router.rs
- sbroad-cartridge/src/cartridge/storage.rs 112 additions, 62 deletionssbroad-cartridge/src/cartridge/storage.rs
- sbroad-cartridge/src/init.lua 1 addition, 1 deletionsbroad-cartridge/src/init.lua
- sbroad-cartridge/src/router.lua 18 additions, 14 deletionssbroad-cartridge/src/router.lua
- sbroad-cartridge/src/storage.lua 19 additions, 4 deletionssbroad-cartridge/src/storage.lua
- sbroad-cartridge/test_app/test/integration/api_test.lua 1 addition, 1 deletionsbroad-cartridge/test_app/test/integration/api_test.lua
- sbroad-core/Cargo.lock 0 additions, 1473 deletionssbroad-core/Cargo.lock
- sbroad-core/Cargo.toml 2 additions, 1 deletionsbroad-core/Cargo.toml
- sbroad-core/src/backend/sql/ir.rs 169 additions, 74 deletionssbroad-core/src/backend/sql/ir.rs
- sbroad-core/src/backend/sql/ir/tests/selection.rs 180 additions, 180 deletionssbroad-core/src/backend/sql/ir/tests/selection.rs
Loading
Please register or sign in to comment