diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2023-10-17 13:18:49 +0200 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2023-10-17 13:18:49 +0200 |
commit | 683b72477cbd542a2ba1a94b02b15c5cf2a3d30a (patch) | |
tree | e6c88a12d5d8ca977e02e8b7bfc1b0523851810c | |
parent | 0494274943bd9ff49f5d2e4ab1d4c211cfc43273 (diff) |
-more fixmes
-rw-r--r-- | src/exchangedb/0002-recoup_refresh.sql | 8 | ||||
-rw-r--r-- | src/exchangedb/exchange_do_melt.sql | 6 | ||||
-rw-r--r-- | src/exchangedb/exchange_do_recoup_to_coin.sql | 4 | ||||
-rw-r--r-- | src/exchangedb/pg_select_recoup_refresh_above_serial_id.c | 2 |
4 files changed, 11 insertions, 9 deletions
diff --git a/src/exchangedb/0002-recoup_refresh.sql b/src/exchangedb/0002-recoup_refresh.sql index 45c785572..5ef2c0873 100644 --- a/src/exchangedb/0002-recoup_refresh.sql +++ b/src/exchangedb/0002-recoup_refresh.sql @@ -82,14 +82,18 @@ DECLARE table_name TEXT DEFAULT 'recoup_refresh'; BEGIN table_name = concat_ws('_', table_name, partition_suffix); - -- FIXME: any query using this index will be slow. Materialize index or change query? - -- Also: which query uses this index? + EXECUTE FORMAT ( 'CREATE INDEX ' || table_name || '_by_rrc_serial_index' ' ON ' || table_name || ' ' '(rrc_serial);' ); EXECUTE FORMAT ( + 'COMMENT ON INDEX ' || table_name || '_by_rrc_serial_index ' + 'IS ' || quote_literal('used in exchange_do_melt for zombie coins (rare)') || ';' + ); + + EXECUTE FORMAT ( 'CREATE INDEX ' || table_name || '_by_coin_pub_index' ' ON ' || table_name || ' ' '(coin_pub);' diff --git a/src/exchangedb/exchange_do_melt.sql b/src/exchangedb/exchange_do_melt.sql index 7451577d8..0200986fa 100644 --- a/src/exchangedb/exchange_do_melt.sql +++ b/src/exchangedb/exchange_do_melt.sql @@ -81,13 +81,13 @@ THEN -- operations, and then see if any of these -- reveal operations was involved in a recoup. PERFORM - FROM exchange.recoup_refresh + FROM recoup_refresh WHERE rrc_serial IN (SELECT rrc_serial - FROM exchange.refresh_revealed_coins + FROM refresh_revealed_coins WHERE melt_serial_id IN (SELECT melt_serial_id - FROM exchange.refresh_commitments + FROM refresh_commitments WHERE old_coin_pub=in_old_coin_pub)); IF NOT FOUND THEN diff --git a/src/exchangedb/exchange_do_recoup_to_coin.sql b/src/exchangedb/exchange_do_recoup_to_coin.sql index 150b62db6..6cecfb7f8 100644 --- a/src/exchangedb/exchange_do_recoup_to_coin.sql +++ b/src/exchangedb/exchange_do_recoup_to_coin.sql @@ -67,7 +67,7 @@ THEN recoup_timestamp INTO out_recoup_timestamp - FROM exchange.recoup_refresh + FROM recoup_refresh WHERE coin_pub=in_coin_pub; out_recoup_ok=FOUND; RETURN; @@ -106,7 +106,7 @@ THEN END IF; -INSERT INTO exchange.recoup_refresh +INSERT INTO recoup_refresh (coin_pub ,known_coin_id ,coin_sig diff --git a/src/exchangedb/pg_select_recoup_refresh_above_serial_id.c b/src/exchangedb/pg_select_recoup_refresh_above_serial_id.c index b6029777c..22e09b46a 100644 --- a/src/exchangedb/pg_select_recoup_refresh_above_serial_id.c +++ b/src/exchangedb/pg_select_recoup_refresh_above_serial_id.c @@ -161,8 +161,6 @@ TEH_PG_select_recoup_refresh_above_serial_id ( }; enum GNUNET_DB_QueryStatus qs; - /* Used in #postgres_select_recoup_refresh_above_serial_id() to obtain - recoup-refresh transactions */ PREPARE (pg, "recoup_refresh_get_incr", "SELECT" |