Skip to content

Optimize transfer history filtering and indexes - #1859

Merged
YoshihitoAso merged 1 commit into
dev-26.9from
improve-transfer-history-performance
Aug 21, 2026
Merged

Optimize transfer history filtering and indexes#1859
YoshihitoAso merged 1 commit into
dev-26.9from
improve-transfer-history-performance

Conversation

@YoshihitoAso

Copy link
Copy Markdown
Member

📌 Description

This PR improves the performance characteristics of transfer history searches by removing partial-match searches for transaction_hash, from_address, and to_address, allowing indexed exact-match lookups to be used more effectively as transfer data grows.

✅ Related Issues

🔄 Changes

  • Changed transaction_hash, from_address, and to_address filters from LIKE '%...%' to exact-match conditions for transfer history APIs.
  • Avoided unnecessary account_tag joins when account_tag is not specified.
  • Added composite indexes for transfer history lookup and ID-ordered pagination patterns.
  • Updated API schema/OpenAPI descriptions to document exact-match search behavior.
  • Updated transfer history tests to use exact-match filter values.

📌 Checklist

  • I have added tests where necessary.
  • I have updated the documentation where necessary.

@github-actions

Copy link
Copy Markdown

Coverage

Coverage Report •
FileStmtsMissBranchBrPartCoverMissing
app/api/routers
   token.py46572902196%267->269, 282->286, 299->303, 316->320, 326->329, 481->483, 489->491, 497->499, 512->516, 522->525, 560->561, 561, 701->702, 702, 864->865, 865, 878->879, 879, 883, 994->997, 1187->1190, 1379->1382, 1423->1427, 1427, 1623->1626, 1820->1823, 1864->1868, 1868
app/model/db
   idx_transfer.py37000100% 
app/model/schema
   token.py202000100% 
tests/app
   token_transfer_history_ListAllTransferHistory_test.py264020100% 
   token_transfer_history_ListTokenTransferHistory_test.py545020100% 
   token_transfer_history_SearchTokenTransferHistory_test.py742020100% 
TOTAL374581470352464795% 

Tests Skipped Failures Errors Time
1281 0 💤 0 ❌ 0 🔥 11m 5s ⏱️

@YoshihitoAso
YoshihitoAso merged commit 1e9857d into dev-26.9 Aug 21, 2026
13 checks passed
@YoshihitoAso
YoshihitoAso deleted the improve-transfer-history-performance branch August 21, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Improve the performance of the TransferHistory API

2 participants