forked from LBRYCommunity/lbry-sdk
add txo_unspent_by_address index
This commit is contained in:
parent
22a04fab24
commit
4d8cc494e1
1 changed files with 3 additions and 0 deletions
|
@ -159,6 +159,9 @@ pg_add_txo_constraints_and_indexes = [
|
|||
# for calculating supports on a claim
|
||||
f"CREATE INDEX txo_unspent_supports ON txo (claim_hash) INCLUDE (amount) "
|
||||
f"WHERE spent_height = 0 AND txo_type={TXO_TYPES['support']};",
|
||||
# for calculating balance
|
||||
f"CREATE INDEX txo_unspent_by_address ON txo (address) INCLUDE (amount) "
|
||||
f"WHERE spent_height = 0;",
|
||||
# for finding modified claims in a block range
|
||||
f"CREATE INDEX txo_claim_changes "
|
||||
f"ON txo (height DESC) INCLUDE (claim_hash, txo_hash) "
|
||||
|
|
Loading…
Reference in a new issue