mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
Revert "wallet: Remove in-memory utxoset filter"
This reverts commitc239a7161b. The goal ofc239a716was to reduce the memory footprint of our internal UTXO set tracking, and testing against the sqlite3 backend showed no performance impact. We have since found that the added roundtrips to the DB server with postgres was having a considerable performance impact, and backups would also bloat due to the increased number of queries. Undoing this change skips the noop updates that were causing this regression. Changelog-Fixed: db: Fixed a performance regression during block sync, resulting in many more queries against the DB than necessary.
This commit is contained in:
committed by
Rusty Russell
parent
3b7d0e7a62
commit
8e908ff652
16
wallet/db_sqlite3_sqlgen.c
generated
16
wallet/db_sqlite3_sqlgen.c
generated
@@ -1052,6 +1052,12 @@ struct db_query db_sqlite3_queries[] = {
|
||||
.placeholders = 1,
|
||||
.readonly = true,
|
||||
},
|
||||
{
|
||||
.name = "SELECT txid, outnum FROM utxoset WHERE spendheight is NULL",
|
||||
.query = "SELECT txid, outnum FROM utxoset WHERE spendheight is NULL",
|
||||
.placeholders = 0,
|
||||
.readonly = true,
|
||||
},
|
||||
{
|
||||
.name = "SELECT * from outputs WHERE prev_out_tx=? AND prev_out_index=?",
|
||||
.query = "SELECT * from outputs WHERE prev_out_tx=? AND prev_out_index=?",
|
||||
@@ -1502,6 +1508,12 @@ struct db_query db_sqlite3_queries[] = {
|
||||
.placeholders = 1,
|
||||
.readonly = false,
|
||||
},
|
||||
{
|
||||
.name = "SELECT txid, outnum FROM utxoset WHERE spendheight < ?",
|
||||
.query = "SELECT txid, outnum FROM utxoset WHERE spendheight < ?",
|
||||
.placeholders = 1,
|
||||
.readonly = true,
|
||||
},
|
||||
{
|
||||
.name = "DELETE FROM utxoset WHERE spendheight < ?",
|
||||
.query = "DELETE FROM utxoset WHERE spendheight < ?",
|
||||
@@ -1756,10 +1768,10 @@ struct db_query db_sqlite3_queries[] = {
|
||||
},
|
||||
};
|
||||
|
||||
#define DB_SQLITE3_QUERY_COUNT 291
|
||||
#define DB_SQLITE3_QUERY_COUNT 293
|
||||
|
||||
#endif /* HAVE_SQLITE3 */
|
||||
|
||||
#endif /* LIGHTNINGD_WALLET_GEN_DB_SQLITE3 */
|
||||
|
||||
// SHA256STAMP:26bbd985dc45de765f06b8c2644ecd76c098532ff71a33c8f71608890631d726
|
||||
// SHA256STAMP:62ee429e3f1823a6f5db9358e3bd25b0b48f1dc7cf78bd22b921f601cde15950
|
||||
|
||||
Reference in New Issue
Block a user