From 9e9c494367ab574d81010215b402dd40139ddb54 Mon Sep 17 00:00:00 2001 From: Greg Heartsfield Date: Wed, 14 Dec 2022 21:03:18 -0600 Subject: [PATCH] perf: significant query speedup when using `kinds`. fixes: https://todo.sr.ht/~gheartsfield/nostr-rs-relay/51 --- src/schema.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/schema.rs b/src/schema.rs index 849caa6..20e446c 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -52,6 +52,7 @@ CREATE INDEX IF NOT EXISTS created_at_index ON event(created_at); CREATE INDEX IF NOT EXISTS author_index ON event(author); CREATE INDEX IF NOT EXISTS delegated_by_index ON event(delegated_by); CREATE INDEX IF NOT EXISTS kind_index ON event(kind); +CREATE INDEX IF NOT EXISTS kind_created_index ON event(kind,created_at); -- Tag Table -- Tag values are stored as either a BLOB (if they come in as a