Skip to content

Commit

Permalink
Merge pull request #594 from oasisprotocol/pro-wh/feature/lessefficient
Browse files Browse the repository at this point in the history
Revert "analyzer/block: more efficient db query on startup"
  • Loading branch information
pro-wh authored Dec 22, 2023
2 parents 6d23919 + 403f07a commit e223f95
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions analyzer/queries/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,11 @@ var (
SELECT COALESCE(max(height), -1) as height
FROM analysis.processed_blocks
WHERE analyzer = $1
),
gaps AS (
SELECT h
FROM highest_encountered_block, generate_series(GREATEST(1, $2::bigint), LEAST(highest_encountered_block.height, $3::bigint)) AS h
EXCEPT
SELECT height FROM analysis.processed_blocks WHERE analyzer = $1
)
INSERT INTO analysis.processed_blocks (analyzer, height, locked_time)
SELECT $1, h, '-infinity'::timestamptz
FROM gaps
FROM highest_encountered_block, generate_series(GREATEST(1, $2::bigint), LEAST(highest_encountered_block.height, $3::bigint)) AS h
ON CONFLICT (analyzer, height) DO NOTHING`

IndexingProgress = `
Expand Down

0 comments on commit e223f95

Please sign in to comment.