wallet/db.c: Speed up deletion of single peers.

ChangeLog-Fixed: Database: Speed up deletion of peer especially when there is a long history with that peer.
This commit is contained in:
ZmnSCPxj jxPCSnmZ
2021-01-18 15:58:24 +08:00
committed by Christian Decker
parent 6f924e63c2
commit 4dfbee47f7
4 changed files with 42 additions and 21 deletions

View File

@@ -872,6 +872,12 @@ struct db_query db_postgres_queries[] = {
.placeholders = 0,
.readonly = false,
},
{
.name = "CREATE INDEX forwarded_payments_out_htlc_id ON forwarded_payments (out_htlc_id);",
.query = "CREATE INDEX forwarded_payments_out_htlc_id ON forwarded_payments (out_htlc_id);",
.placeholders = 0,
.readonly = false,
},
{
.name = "UPDATE vars SET intval = intval + 1 WHERE name = 'data_version' AND intval = ?",
.query = "UPDATE vars SET intval = intval + 1 WHERE name = 'data_version' AND intval = $1",
@@ -1774,10 +1780,10 @@ struct db_query db_postgres_queries[] = {
},
};
#define DB_POSTGRES_QUERY_COUNT 294
#define DB_POSTGRES_QUERY_COUNT 295
#endif /* HAVE_POSTGRES */
#endif /* LIGHTNINGD_WALLET_GEN_DB_POSTGRES */
// SHA256STAMP:ca47a99b5c64139f4556f3bf77a6d984cb9ab6b38bcd2851bc551c75c5cc240a
// SHA256STAMP:910328b3c942486b746f7f5d2a91fad65ae9eb54032a5828705132bfa1b86eaf