cln/db
Rusty Russell 47ab467bc1 db: don't actually create an explicit transaction for read commands.
Since we are the only writer, we don't need one.

Name (time in s)                               Min     Max    Mean  StdDev  Median
sqlite: test_spam_listcommands  (before)    2.1193  2.4524  2.2343  0.1341  2.2229
sqlite: test_spam_listcommands  (after)     2.0140  2.2349  2.1001  0.0893  2.0644
Postgres: test_spam_listcommands (before)   6.5572  6.8440  6.7067  0.1032  6.6967
Postgres: test_spam_listcommands (after)    4.4237  5.0024  4.6495  0.2278  4.6717

A nice 31% speedup!

Changelog-Changed: Postgres: significant speedup on read-only operations (e.g. 30% on empty SELECTs)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-11-20 16:30:50 +10:30
..
bindings.c global: remove unnecessary includes from C files. 2025-10-23 06:44:04 +10:30
bindings.h db: helper for binding/reading bitcoin_outpoint. 2025-08-19 13:37:50 +09:30
common.h db: don't start transactions unless we really need to. 2025-11-20 16:30:50 +10:30
db_postgres.c db: support mode where we don't want to create the db. 2025-08-19 13:37:50 +09:30
db_sqlite3.c db: don't start transactions unless we really need to. 2025-11-20 16:30:50 +10:30
exec.c db: don't start transactions unless we really need to. 2025-11-20 16:30:50 +10:30
exec.h db: don't start transactions unless we really need to. 2025-11-20 16:30:50 +10:30
Makefile database: pull out database code into a new module 2022-03-05 15:03:34 +10:30
utils.c db: don't actually create an explicit transaction for read commands. 2025-11-20 16:30:50 +10:30
utils.h db: support mode where we don't want to create the db. 2025-08-19 13:37:50 +09:30