docs: add release notes for invoice SQL query performance improvements
What changed, and why it matters
This commit only adds a release note describing a previous performance improvement to invoice database queries. It changes documentation text only and does not modify any code, configuration, or security behavior. There is no security issue here.
No action required. This is a documentation-only release-note update with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds a single bullet to docs/release-notes/release-notes-0.21.0.md summarizing PR #10601, which replaced a slow SQL query in the invoice subsystem with five optimized queries. The commit is purely documentation; no source code, SQL schema, or API surface is altered. The described change is a performance optimization (avoiding full table scans), not a security fix.
Changed components
docs/release-notes/release-notes-0.21.0.mdInspect captured patch +10 / −0
diff --git a/docs/release-notes/release-notes-0.21.0.md b/docs/release-notes/release-notes-0.21.0.md
index f81ba63..d4f00dc 100644
--- a/docs/release-notes/release-notes-0.21.0.md
+++ b/docs/release-notes/release-notes-0.21.0.md
@@ -135,6 +135,16 @@
## Performance Improvements
+* [Replace the catch-all `FilterInvoices` SQL query with five focused,
+ index-friendly queries](https://github.com/lightningnetwork/lnd/pull/10601)
+ (`FetchPendingInvoices`, `FilterInvoicesBySettleIndex`,
+ `FilterInvoicesByAddIndex`, `FilterInvoicesForward`,
+ `FilterInvoicesReverse`). The old query used `col >= $param OR $param IS
+ NULL` predicates and a `CASE`-based `ORDER BY` that prevented SQLite's query
+ planner from using indexes, causing full table scans. Each new query carries
+ only the parameters it actually needs and uses a direct `ORDER BY`, allowing
+ the planner to perform efficient index range scans on the invoice table.
+
## Deprecations
### ⚠️ **Warning:** The deprecated fee rate option `--sat_per_byte` will be removed in release version **0.22**
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.