From 16b774a69ed8421696417d9f45fe32c2f636e0f0 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Tue, 4 Jun 2019 20:38:34 -0400 Subject: [PATCH] add normalized to claims_in_channel index to make update claim faster --- lbrynet/wallet/server/db.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lbrynet/wallet/server/db.py b/lbrynet/wallet/server/db.py index 4b55b894a..ba81fd3c9 100644 --- a/lbrynet/wallet/server/db.py +++ b/lbrynet/wallet/server/db.py @@ -127,7 +127,7 @@ class SQLDB: ); create index if not exists claim_resolve_idx on claim (normalized, claim_id); - create index if not exists claim_claims_in_channel_idx on claim (signature_valid, channel_hash); + create index if not exists claim_claims_in_channel_idx on claim (signature_valid, channel_hash, normalized); create index if not exists claim_id_idx on claim (claim_id); create index if not exists claim_normalized_idx on claim (normalized); @@ -505,9 +505,9 @@ class SQLDB: (SELECT short_url FROM claim WHERE claim_hash=:channel_hash)||'/'|| claim_name||COALESCE( (SELECT shortest_id(other_claim.claim_id, claim.claim_id) FROM claim AS other_claim - WHERE other_claim.normalized = claim.normalized AND + WHERE other_claim.signature_valid = 1 AND other_claim.channel_hash = :channel_hash AND - other_claim.signature_valid = 1), + other_claim.normalized = claim.normalized), '#'||substr(claim_id, 1, 1) ) END