summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-05-02 20:51:34 +0200
committerChristian Grothoff <christian@grothoff.org>2022-05-02 20:51:34 +0200
commit7ebdac0a8bccd6842382376653403cd3d82ffab0 (patch)
treefd4d9aa0e2bb444de84941857cfd184df93965e4
parent0a7b75b2cf9f5994a33b2edd93158319569e4535 (diff)
downloadexchange-7ebdac0a8bccd6842382376653403cd3d82ffab0.tar.gz
exchange-7ebdac0a8bccd6842382376653403cd3d82ffab0.tar.bz2
exchange-7ebdac0a8bccd6842382376653403cd3d82ffab0.zip
-investigate FIXME
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index 644b9f5ca..aa4066e6f 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -2198,10 +2198,11 @@ prepare_statements (struct PostgresClosure *pg)
",amount_frac"
",recoup_timestamp"
",recoup_uuid"
- " FROM recoup"
- // FIXME: suboptimal sub-query here: crosses shards!
- // MAYBE: replace reserve_out_serial_id with
- // reserve_pub and use new reserve_out_by_reserve table?
+ " FROM recoup rcp"
+ /* NOTE: suboptimal JOIN follows: crosses shards!
+ Could theoretically be improved via a materialized
+ index. But likely not worth it (query is rare and
+ number of reserve shards might be limited) */
" JOIN reserves_out ro"
" USING (reserve_out_serial_id)"
" JOIN reserves"