Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow unbundled blocks query #156

Open
segfault-magnet opened this issue Oct 31, 2024 · 0 comments
Open

Slow unbundled blocks query #156

segfault-magnet opened this issue Oct 31, 2024 · 0 comments

Comments

@segfault-magnet
Copy link
Contributor

2024-10-31T13:20:21.871545982Z stderr F {"timestamp":"2024-10-31T13:20:21.871419Z","level":"WARN","fields":{"message":"slow statement: execution time exceeded alert threshold","summary":"SELECT fb.* FROM fuel_blocks …","db.statement":"\n\nSELECT\n fb.*\nFROM\n fuel_blocks fb\nWHERE\n fb.height >= $1\n AND NOT EXISTS (\n SELECT\n 1\n FROM\n bundles b\n WHERE\n fb.height BETWEEN b.start_height AND b.end_height\n )\nORDER BY\n fb.height\nLIMIT\n $2\n","rows_affected":2625,"rows_returned":2625,"elapsed":"1.887714259s","elapsed_secs":1.887714259,"slow_threshold":"1s"},"target":"sqlx::query","line_number":120}

It happens when we set the lookback to around 100k blocks.

We need to look into this since we aim to set the lookback to a few million.

An index on the bundle heights should fix but needs investigating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant