Added index to forwarded_payments.state to speedup lookups using this column

This commit is contained in:
Karol Hosiawa
2021-01-23 18:19:47 +01:00
committed by Rusty Russell
parent 8a8f81175d
commit c1e958d2b9
4 changed files with 41 additions and 24 deletions

View File

@@ -884,6 +884,12 @@ struct db_query db_postgres_queries[] = {
.placeholders = 0,
.readonly = false,
},
{
.name = "CREATE INDEX forwarded_payments_state ON forwarded_payments (state)",
.query = "CREATE INDEX forwarded_payments_state ON forwarded_payments (state)",
.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",
@@ -1786,10 +1792,10 @@ struct db_query db_postgres_queries[] = {
},
};
#define DB_POSTGRES_QUERY_COUNT 296
#define DB_POSTGRES_QUERY_COUNT 297
#endif /* HAVE_POSTGRES */
#endif /* LIGHTNINGD_WALLET_GEN_DB_POSTGRES */
// SHA256STAMP:4a878278ad7a1d427b80ff3a2abe34ae82cd73cf635ecf25e5cb20532c0604be
// SHA256STAMP:bbe38ba26543917c2c8be0eeba93c2d0345b51f7f29803e30cc3f03aaf077798