Bring query utxo by address command performance on par with current version
QA reported that the query utxo --address command took about 10 seconds. The baseline (1.35.0 at the time of testing) took ~2.3 seconds. Furthermore, the query returned an empty set of addresses where 4 addresses were expected.
We need to fix the command and bring the performance of said command on par with the baseline.
This query is inefficient in LMDB because
- we need to do disk access AND
- we do it incrementally AND
- we need to stow the ledger tables.
This query is inefficient in InMemory because
- we do it incrementally AND
- we need to stow the ledger tables.
Possible solutions:
-
InMemorycan do the query all at once, no need to do it incrementally (8s > 5s). - Make the UTxO filtering functions target the
CardanoLedgerTablesand then stow the result (should take us to the theoretical limit). - Make this query faster, for instance by indexing by addresses.
- Create a service to answer this query.
@Jasagredo said:
For reference, returning the whole UTxO at once in the
InMemorybackend, measuring the time spent instowLedgerTables(can ignore the bottom part, only the first 4 lines are relevant).
We should deprecate this query in the node (not in the cardano-cli!), and move it to an external service that maintains this index. cardano-cli can provide this functionality through said indexing service. Efforts to implement this query in this way are tracked in this issue.
As for this issue, I think to close it we need to:
do the query all at once in the
InMemorybackend, no need to do it incrementally (8s > 5s).
CC: @Jasagredo @vfrsilva @disassembler