Conversation
JssDWt
force-pushed
the
jssdwt-missing-indices
branch
from
September 17, 2026 14:36
a15cdef to
7af4635
Compare
Contributor
Author
|
Rebased. |
Postgres doesn't index the referencing side of a foreign key, so every row deleted from `blocks` scans `transactions`, `channeltxs` and `outputs` in full. Postgres was taking 100% CPU for multiple minutes, causing startup timeouts in systemd. 247aa13 and 50a8e32 added indices for `outputs` and `utxoset` in 2018. `channeltxs` (28feb2e) and `transactions` (0f89653) arrived weeks later without one. `outputs` is only half-covered: `output_height_idx` is (`confirmation_height`, `spend_height`), which doesn't serve a lookup on `spend_height` alone. Changelog-Fixed: db: much faster startup on postgres nodes with large `transactions` or `channeltxs` tables.
JssDWt
force-pushed
the
jssdwt-missing-indices
branch
from
October 1, 2026 18:26
7af4635 to
4eb1e34
Compare
Contributor
Author
|
Rebased. Any takers? I know you guys are busy. This was a startup hang blocker for us. |
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add missing simple indexes.
Changelog-Fixed: db: much faster startup on postgres nodes with large
transactionsorchanneltxstables.Tested on a production node running into the issue described above (fixes it).