lnd/sqldb/sqlc/migrations
ziggie 65f6d75511
sqldb: drop redundant and unused invoice indexes
Remove four indexes from the invoices table that either duplicate existing
UNIQUE constraint indexes or are never used in WHERE clauses:

- invoices_hash_idx: redundant, UNIQUE constraint on hash already creates
  an implicit index
- invoices_payment_addr_idx: redundant, UNIQUE constraint on payment_addr
  already creates an implicit index
- invoices_preimage_idx: unused, preimage is NULL on all new invoices and
  is never used as a query filter
- invoices_settled_at_idx: unused, settled_at is NULL on all pending
  invoices and is never used as a query filter (settle_index is used
  instead)

Dropping these reduces B-tree working set size, which improves page cache
utilization as the invoice table grows.
2026-03-04 13:04:26 +01:00
..
000001_invoices.down.sql sqldb: delete wrong index names and add missing one 2025-08-14 08:17:15 +02:00
000001_invoices.up.sql sqldb: make migration 1 and 3 idempotent 2025-03-28 11:00:56 +01:00
000002_amp_invoices.down.sql sqldb: add AMP invoices SQL schema 2023-07-10 17:53:56 -07:00
000002_amp_invoices.up.sql sqldb: simplify and fixup the existing invoice store schema and queries 2024-03-01 10:08:07 +01:00
000003_invoice_events.down.sql sqldb: simplify and fixup the existing invoice store schema and queries 2024-03-01 10:08:07 +01:00
000003_invoice_events.up.sql sqldb: make migration 1 and 3 idempotent 2025-03-28 11:00:56 +01:00
000004_invoice_expiry_fix.down.sql sqldb+invoices: add migration to fix incorrectly stored invoice expiries 2024-07-09 08:39:57 +02:00
000004_invoice_expiry_fix.up.sql sqldb+invoices: add migration to fix incorrectly stored invoice expiries 2024-07-09 08:39:57 +02:00
000005_migration_tracker.down.sql sqldb: add table to track custom SQL migrations 2025-01-23 09:10:59 +01:00
000005_migration_tracker.up.sql sqldb: add table to track custom SQL migrations 2025-01-23 09:10:59 +01:00
000006_invoice_migration.down.sql sqldb: add a temporary index to store KV invoice hash to ID mapping 2025-01-23 09:11:00 +01:00
000006_invoice_migration.up.sql sqldb: add a temporary index to store KV invoice hash to ID mapping 2025-01-23 09:11:00 +01:00
000007_invoice_add_settled_index.down.sql sqldb: use the new schema 2025-08-14 11:59:09 +02:00
000007_invoice_add_settled_index.up.sql sqldb: use the new schema 2025-08-14 11:59:09 +02:00
000008_graph.down.sql sqldb: use the new schema 2025-08-14 11:59:09 +02:00
000008_graph.up.sql sqldb: use the new schema 2025-08-14 11:59:09 +02:00
000009_graph_v2.down.sql sqldb: add new gossip v2 columns to graph tables 2026-02-13 07:21:20 +02:00
000009_graph_v2.up.sql sqldb: add new gossip v2 columns to graph tables 2026-02-13 07:21:20 +02:00
000010_payments.down.sql paymentsdb: fix duplicate interface check and down migration drop order 2026-02-25 18:36:14 +01:00
000010_payments.up.sql sqldb: rename 000009_payments to 000010_payments 2026-02-25 08:02:27 +01:00
000011_payment_duplicates.down.sql sqldb+payments: add payment_duplicates for legacy duplicate payments 2026-02-25 18:52:32 +01:00
000011_payment_duplicates.up.sql sqldb+payments: add payment_duplicates for legacy duplicate payments 2026-02-25 18:52:32 +01:00
000012_drop_redundant_invoice_indexes.down.sql sqldb: drop redundant and unused invoice indexes 2026-03-04 13:04:26 +01:00
000012_drop_redundant_invoice_indexes.up.sql sqldb: drop redundant and unused invoice indexes 2026-03-04 13:04:26 +01:00