Skip to content

Commit

Permalink
No need to check payer when query get_transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
harrywong committed Feb 13, 2019
1 parent 7b7e8e0 commit c0eee95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions plugins/history_plugin/evt_pg_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,8 +795,8 @@ pg_query::get_transaction_resume(int id, pg_result const* r) {
EVT_THROW(chain::unknown_transaction_exception, "Cannot find transaction: ${t}", ("t", trx_id));
}

PREPARE_SQL_ONCE(gtrxs_plan0, "SELECT block_num, trx_id FROM transactions WHERE keys && $1 OR payer = ANY($1) ORDER BY timestamp DESC LIMIT $2 OFFSET $3;")
PREPARE_SQL_ONCE(gtrxs_plan1, "SELECT block_num, trx_id FROM transactions WHERE keys && $1 OR payer = ANY($1) ORDER BY timestamp ASC LIMIT $2 OFFSET $3;")
PREPARE_SQL_ONCE(gtrxs_plan0, "SELECT block_num, trx_id FROM transactions WHERE keys && $1 ORDER BY timestamp DESC LIMIT $2 OFFSET $3;")
PREPARE_SQL_ONCE(gtrxs_plan1, "SELECT block_num, trx_id FROM transactions WHERE keys && $1 ORDER BY timestamp ASC LIMIT $2 OFFSET $3;")

int
pg_query::get_transactions_async(int id, const read_only::get_transactions_params& params) {
Expand Down
4 changes: 0 additions & 4 deletions plugins/postgres_plugin/evt_pg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ auto create_trxs_table = R"sql(CREATE TABLE IF NOT EXISTS public.transactions
ON public.transactions USING btree
(block_num)
TABLESPACE pg_default;
CREATE INDEX IF NOT EXISTS transactions_payer_index
ON transactions USING btree
(payer)
TABLESPACE pg_default;
CREATE INDEX IF NOT EXISTS transactions_timestamp_index
ON transactions USING btree
(timestamp)
Expand Down

0 comments on commit c0eee95

Please sign in to comment.