From 2e372edde4109547aa38af107d3f9e624cd0b8d8 Mon Sep 17 00:00:00 2001 From: i-norden Date: Thu, 30 Nov 2023 13:03:36 -0600 Subject: [PATCH] add index to event.emitter_addr --- chain/events/filter/index.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chain/events/filter/index.go b/chain/events/filter/index.go index c7adaee18..e15a8ada4 100644 --- a/chain/events/filter/index.go +++ b/chain/events/filter/index.go @@ -46,6 +46,7 @@ var ddls = []string{ )`, `CREATE INDEX IF NOT EXISTS height_tipset_key ON event (height,tipset_key)`, + `CREATE INDEX IF NOT EXISTS event_emitter_addr ON event (emitter_addr)`, `CREATE TABLE IF NOT EXISTS event_entry ( event_id INTEGER, @@ -327,7 +328,8 @@ func NewEventIndex(ctx context.Context, path string, chainStore *store.ChainStor if version == 2 { log.Infof("upgrading event index from version 1 to version 2") - // to upgrade to version 3 we only need to create an index on the event entries table (key) column + // to upgrade to version 3 we only need to create an index on the event_entry.key column + // and on the event.emitter_addr column // which means we can just reapply the schema (it will not have any effect on existing data) for _, ddl := range ddls { if _, err := db.Exec(ddl); err != nil {