blockbook icon indicating copy to clipboard operation
blockbook copied to clipboard

query transaction by outpoint is too slow

Open thebevrishot opened this issue 5 years ago • 2 comments

The api /spending/<txid>/<index> is too slow. After I examined the code seems like Blockbook iterates over all transactions that related to the address. It has a massive effect when a user tries to query an address that is related to a lot of transactions. For example in my case when a user tries to query by outpoint that related to an address that receives rewards every block, it need to iterate over 200k entries.

I believe we need an outpoint index to make this more efficient.

thebevrishot avatar Nov 25 '19 10:11 thebevrishot

Hi, would https://github.com/trezor/blockbook/issues/251 help you?

martinboehm avatar Nov 25 '19 14:11 martinboehm

Yes, That's what I looking for. Thanks! However, do you have plan to include it to master branch soon?

thebevrishot avatar Nov 26 '19 05:11 thebevrishot

The newly implemented -extendedindex option adds the feature.

martinboehm avatar Mar 15 '23 22:03 martinboehm