gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] 02/03: improve style of some SQL queries (no semantic c


From: gnunet
Subject: [taler-exchange] 02/03: improve style of some SQL queries (no semantic change)
Date: Sat, 19 Mar 2022 08:35:19 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

commit 280f94c3a664520f1f63ea353556c5bc84fee87f
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Sat Mar 19 08:27:01 2022 +0100

    improve style of some SQL queries (no semantic change)
---
 contrib/gana                                |  2 +-
 src/exchangedb/plugin_exchangedb_postgres.c | 31 ++++++++++++++++-------------
 src/lib/exchange_api_deposit.c              |  1 -
 src/lib/exchange_api_handle.c               |  1 -
 4 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/contrib/gana b/contrib/gana
index 048ad729..baeb8203 160000
--- a/contrib/gana
+++ b/contrib/gana
@@ -1 +1 @@
-Subproject commit 048ad729b3177a5de1726517bc905e6cd7688d0d
+Subproject commit baeb820366b88befd6f5aa2a551e2827ef406daf
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c 
b/src/exchangedb/plugin_exchangedb_postgres.c
index 6912e55e..c078d65a 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -722,13 +722,13 @@ prepare_statements (struct PostgresClosure *pg)
       ",ro.amount_with_fee_frac"
       ",denom.fee_withdraw_val"
       ",denom.fee_withdraw_frac"
-      " FROM denominations denom"
-      " JOIN reserves_out ro"
-      "   ON (ro.denominations_serial = denom.denominations_serial)"
+      " FROM reserves res"
       " JOIN reserves_out_by_reserve ror"
-      "   ON (ro.h_blind_ev = ror.h_blind_ev)"
-      " JOIN reserves res"
       "   ON (res.reserve_uuid = ror.reserve_uuid)"
+      " JOIN reserves_out ro"
+      "   ON (ro.h_blind_ev = ror.h_blind_ev)"
+      " JOIN denominations denom"
+      "   ON (ro.denominations_serial = denom.denominations_serial)"
       " WHERE res.reserve_pub=$1;",
       1),
     /* Used in #postgres_select_withdrawals_above_serial_id() */
@@ -1654,17 +1654,17 @@ prepare_statements (struct PostgresClosure *pg)
       "  recoup_timestamp,"
       "  denoms.denom_pub_hash,"
       "  coins.denom_sig"
-      " FROM denominations denoms"
-      " JOIN known_coins coins"
-      "   ON (coins.denominations_serial = denoms.denominations_serial)"
-      " JOIN recoup rc"
-      "   ON (rc.coin_pub = coins.coin_pub)"
-      " JOIN reserves_out ro"
-      "   ON (ro.reserve_out_serial_id = rc.reserve_out_serial_id)"
+      " FROM reserves res"
       " JOIN reserves_out_by_reserve ror"
-      "   ON (ror.h_blind_ev = ro.h_blind_ev)"
-      " JOIN reserves res"
       "   ON (res.reserve_uuid = ror.reserve_uuid)"
+      " JOIN reserves_out ro"
+      "   ON (ror.h_blind_ev = ro.h_blind_ev)"
+      " JOIN recoup rc"
+      "   ON (ro.reserve_out_serial_id = rc.reserve_out_serial_id)"
+      " JOIN known_coins coins"
+      "   ON (rc.coin_pub = coins.coin_pub)"
+      " JOIN denominations denoms"
+      "   ON (coins.denominations_serial = denoms.denominations_serial)"
       " WHERE res.reserve_pub=$1;",
       1),
     /* Used in #postgres_get_coin_transactions() to obtain recoup transactions
@@ -1743,6 +1743,9 @@ prepare_statements (struct PostgresClosure *pg)
       ",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?
       " JOIN reserves_out ro"
       "   USING (reserve_out_serial_id)"
       " JOIN reserves"
diff --git a/src/lib/exchange_api_deposit.c b/src/lib/exchange_api_deposit.c
index 15bf76fe..a08a6f42 100644
--- a/src/lib/exchange_api_deposit.c
+++ b/src/lib/exchange_api_deposit.c
@@ -382,7 +382,6 @@ handle_deposit_finished (void *cls,
       TEAH_get_auditors_for_dc (dh->exchange,
                                 &auditor_cb,
                                 dh);
-
     }
     dr.details.success.exchange_sig = &dh->exchange_sig;
     dr.details.success.exchange_pub = &dh->exchange_pub;
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index 24b762c2..ff4686a5 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -598,7 +598,6 @@ update_auditors (struct TALER_EXCHANGE_Handle *exchange)
     GNUNET_CONTAINER_DLL_insert (exchange->auditors_head,
                                  exchange->auditors_tail,
                                  ale);
-
     ale->ah = TALER_AUDITOR_connect (exchange->ctx,
                                      ale->auditor_url,
                                      &auditor_version_cb,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]