status-go/services/wallet/transfer
Stefan 579f7e4a52 chore(wallet) optimize the filer query
Main changes:

- Use tr_type instead of IN clause
- Use binary (X'...' syntax) directly into the query instead of
  converting DB values to HEX
  - Found to be slightly faster than query parameters in the dedicated benchmark
  - Didn't see much improvement in filter benchmarks
- Tried various combinations of optimizations but without impressive performance results

Benchmark results:

| Name                   | Original   | tr_type   | join     | hex      | no-db     | db_only   |     last |    net_j |
|:-----------------------|:-----------|:----------|:---------|:---------|:----------|:----------|---------:|---------:|
| RAM_NoFilter-10        | 49580229   | 51253242  | 51112462 | 50915133 | 121217817 | 141691008 | 50908642 | 50239712 |
| SSD_NoFilter-10        | 49963604   | 51393588  | 51213038 | 50881483 | 120785679 | 141063467 | 50462767 | 49676867 |
| SSD_MovingWindow-10    | 53695712   | 54155292  | 54161733 | 54061325 | 126966633 | 146866017 | 53479929 | 53350475 |
| SSD_AllAddr_AllTos-10  | 41382804   | 41195225  | 51684175 | 52107262 | 64348100  | 97608833  | 50523529 | 49968321 |
| SSD_OneAddress-10      | 34945275   | 35103850  | 31066429 | 31328762 | 50927300  | 54322971  | 30098529 | 30252546 |
| FilterSend_AllAddr-10  | 39546808   | 37566604  | 38389725 | 38260738 | 114820458 | 125588408 | 37127625 | 36864575 |
| FilterSend_6Addr-10    | 41221458   | 41111225  | 40848288 | 40135492 | 118629700 | 128200467 | 38942521 | 39012100 |
| FilterThreeNetworks-10 | -          | -         | -        | -        | -         | -         | 50058929 | 49854450 |

Update status-desktop: #11036
2023-09-21 13:56:44 +02:00
..
block_dao.go fix(wallet): balance history used a wrong db for accessing accounts. 2023-08-30 10:17:57 +02:00
block_ranges_sequential_dao.go feat(wallet): SequentialFetchStrategy improvements: (#3551) 2023-06-01 16:09:50 +03:00
block_test.go fix(tests): moved test db setup to a common place 't/helpers', created 2023-08-18 09:00:56 +02:00
bridge_identifier.go feat(wallet): detect ETH L2 to L1/L2 bridge transactions 2023-07-10 09:59:05 -03:00
commands.go Basic test for findBlocksCommand 2023-09-19 13:17:36 +02:00
commands_sequential.go Basic test for findBlocksCommand 2023-09-19 13:17:36 +02:00
commands_sequential_test.go Basic test for findBlocksCommand 2023-09-19 13:17:36 +02:00
concurrent.go feat(wallet): move balance cache to a common place and make it a 2023-09-05 12:20:49 +02:00
concurrent_test.go fix(wallet): added ChainID to balance cache, as now it is shared between 2023-09-07 15:00:19 +02:00
controller.go feat(wallet): move balance cache to a common place and make it a 2023-09-05 12:20:49 +02:00
database.go fix(wallet) send/receive for duplicate transactions 2023-09-12 11:58:24 +02:00
database_test.go fix(wallet) propagate multi-transactions IDs to transfers 2023-08-22 18:39:42 +02:00
downloader.go Basic test for findBlocksCommand 2023-09-19 13:17:36 +02:00
iterative.go fix(wallet) send/receive for duplicate transactions 2023-09-12 11:58:24 +02:00
iterative_test.go feat: enable wallet without network binding (#2349) 2021-09-09 16:28:54 +02:00
query.go feat(wallet) extract json blobs and add custom migration support 2023-06-08 13:54:40 +02:00
reactor.go feat(wallet): move balance cache to a common place and make it a 2023-09-05 12:20:49 +02:00
sequential_fetch_strategy.go feat(wallet): move balance cache to a common place and make it a 2023-09-05 12:20:49 +02:00
swap_identifier.go feat(wallet): detect ETH L1 to L2 bridge transactions 2023-07-10 09:59:05 -03:00
testutils.go chore(wallet) optimize the filer query 2023-09-21 13:56:44 +02:00
transaction.go fix(wallet) propagate multi-transactions IDs to transfers 2023-08-22 18:39:42 +02:00
transaction_test.go fix(tests): moved test db setup to a common place 't/helpers', created 2023-08-18 09:00:56 +02:00
view.go feat(wallet) extract json blobs and add custom migration support 2023-06-08 13:54:40 +02:00