From d1ac066c6d4c91d0c32f2a1bc2c818a65012bb55 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Thu, 16 Jul 2020 10:53:03 -0400 Subject: [PATCH] include claim_hash in txo_claim_chahges postgres index --- lbry/db/tables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbry/db/tables.py b/lbry/db/tables.py index ee931f211..27b8523b8 100644 --- a/lbry/db/tables.py +++ b/lbry/db/tables.py @@ -110,7 +110,7 @@ pg_add_txo_constraints_and_indexes = [ f"WHERE spent_height = 0 AND txo_type={TXO_TYPES['support']};", # for finding modified claims in a block range f"CREATE INDEX txo_claim_changes " - f"ON txo (height DESC) INCLUDE (txo_hash) " + f"ON txo (height DESC) INCLUDE (claim_hash, txo_hash) " f"WHERE spent_height = 0 AND txo_type IN {tuple(CLAIM_TYPE_CODES)};", # for finding claims which need support totals re-calculated in a block range f"CREATE INDEX txo_added_supports_by_height ON txo (height DESC) "