Speed up fetching transactions using block signature

This commit is contained in:
catbref 2020-09-11 15:56:19 +01:00
parent c628f97d8c
commit 5ea90f2fdd

View File

@ -175,7 +175,11 @@ public class HSQLDBBlockRepository implements BlockRepository {
public List<TransactionData> getTransactionsFromSignature(byte[] signature, Integer limit, Integer offset, Boolean reverse) throws DataException {
StringBuilder sql = new StringBuilder(256);
sql.append("SELECT transaction_signature FROM BlockTransactions WHERE block_signature = ? ORDER BY sequence");
sql.append("SELECT transaction_signature FROM BlockTransactions WHERE block_signature = ? ORDER BY block_signature");
if (reverse != null && reverse)
sql.append(" DESC");
sql.append(", sequence");
if (reverse != null && reverse)
sql.append(" DESC");