-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(db-index): Add missing index from FRI prover jobs (#334)
# What ❔ Add missing index from FRI prover job ## Why ❔ Required to run query efficiently ## Checklist - [ *] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ *] Tests for the changes have been added / updated. - [ *] Documentation comments have been added / updated. - [ *] Code has been formatted via `zk fmt` and `zk lint`.
- Loading branch information
1 parent
eefaad0
commit 730447f
Showing
4 changed files
with
88 additions
and
67 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
core/lib/dal/migrations/20231027074517_add_missing_index_for_fri_prover_tables.down.sql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE INDEX IF NOT EXISTS idx_prover_jobs_fri_status_processing_attempts | ||
ON prover_jobs_fri (processing_started_at, attempts) | ||
WHERE status IN ('in_progress', 'failed'); | ||
|
||
DROP INDEX IF EXISTS prover_jobs_fri_status_processing_started_at_idx_2; | ||
|
||
DROP INDEX IF EXISTS idx_prover_jobs_fri_status; | ||
|
||
DROP INDEX IF EXISTS idx_prover_jobs_fri_circuit_id_agg_batch_num; |
11 changes: 11 additions & 0 deletions
11
core/lib/dal/migrations/20231027074517_add_missing_index_for_fri_prover_tables.up.sql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE INDEX IF NOT EXISTS prover_jobs_fri_status_processing_started_at_idx_2 ON prover_jobs_fri (status, processing_started_at) | ||
WHERE (attempts < 20); | ||
|
||
DROP INDEX IF EXISTS idx_prover_jobs_fri_status_processing_attempts; | ||
|
||
CREATE INDEX IF NOT EXISTS idx_prover_jobs_fri_status ON prover_jobs_fri (circuit_id, aggregation_round) | ||
WHERE (status != 'successful' and status != 'skipped'); | ||
|
||
CREATE INDEX IF NOT EXISTS idx_prover_jobs_fri_circuit_id_agg_batch_num | ||
ON prover_jobs_fri (circuit_id, aggregation_round, l1_batch_number) | ||
WHERE status IN ('queued', 'in_progress', 'in_gpu_proof', 'failed'); |
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