Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
refactor(db): Improve storage logs pruning query – add block condition (
Browse files Browse the repository at this point in the history
matter-labs#2285)

## What ❔

Adds a block condition for the storage logs pruning query.

## Why ❔

This should improve the query plan.

## Checklist

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [x] Code has been formatted via `zk fmt` and `zk lint`.
- [x] Spellcheck has been run via `zk spellcheck`.
  • Loading branch information
slowli authored Jun 20, 2024
1 parent 3f88b8d commit dd2c941
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/lib/dal/src/pruning_dal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ impl PruningDal<'_, '_> {
DELETE FROM storage_logs USING new_logs
WHERE
storage_logs.hashed_key = new_logs.hashed_key
AND storage_logs.miniblock_number <= $2
AND (storage_logs.miniblock_number, storage_logs.operation_number) < (new_logs.miniblock_number, new_logs.operation_number)
"#,
i64::from(l2_blocks_to_prune.start().0),
Expand Down

0 comments on commit dd2c941

Please sign in to comment.