mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-21 16:41:14 +03:00
tell sqlite to use the puzzle_hash index when looking up coins by puzzle_hash (#9352)
This commit is contained in:
parent
f4f58b6878
commit
2fb72c1297
@ -268,7 +268,8 @@ class CoinStore:
|
||||
coins = set()
|
||||
puzzle_hashes_db = tuple([ph.hex() for ph in puzzle_hashes])
|
||||
cursor = await self.coin_record_db.execute(
|
||||
f'SELECT * from coin_record WHERE puzzle_hash in ({"?," * (len(puzzle_hashes) - 1)}?) '
|
||||
f"SELECT * from coin_record INDEXED BY coin_puzzle_hash "
|
||||
f'WHERE puzzle_hash in ({"?," * (len(puzzle_hashes) - 1)}?) '
|
||||
f"AND confirmed_index>=? AND confirmed_index<? "
|
||||
f"{'' if include_spent_coins else 'AND spent=0'}",
|
||||
puzzle_hashes_db + (start_height, end_height),
|
||||
|
Loading…
Reference in New Issue
Block a user