Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ListLeasedOutputs can be very slow #943

Open
yyforyongyu opened this issue Jul 31, 2024 · 0 comments
Open

ListLeasedOutputs can be very slow #943

yyforyongyu opened this issue Jul 31, 2024 · 0 comments

Comments

@yyforyongyu
Copy link
Collaborator

Initially discovered in this issue: lightningnetwork/lnd#8809. Some initial analysis re the bucket lookups when calling ListLeasedOutputs, these buckets are visited at least once, with some of them doing key lookup, while others doing cursor iterations,

bucket: wtxmgrNamespaceKey
	bucket: bucketUnminedCredits
		key: outpoint
		value: []byte
	bucket: bucketUnspent
		key: outpoint
		value: []byte
	bucket: bucketLockedOutputs
		key: outpoint
		value: lockID, expiry
	bucket: bucketUnmined
		key: txhash
		value: wtxmgr.TxRecord
	bucket: bucketUnminedCredits
		key: outpoint
		value: amount
	bucket: bucketUnminedInputs
		key: outpoint
		value: []byte
	bucket: bucketCredits
		key: [72]byte (txhash+op+index)
		value: amount (9 bytes)
	bucket: bucketTxRecords
		key: txhash+wtxmgr.Block
		value: wtxmgr.TxRecord
	bucket: bucketBlocks
		key: block height
		value: [44]byte
	bucket: bucketDebits
		key: ?
		value: wtxmgr.DebitRecord
	bucket: bucketTxLabels
		key: txid
		value: string

Will investigate more to see how we can improve this query.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant