diff --git a/chain/events/filter/index.go b/chain/events/filter/index.go index b1cc2ea5f..0f4a54c5b 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, @@ -325,9 +326,10 @@ func NewEventIndex(ctx context.Context, path string, chainStore *store.ChainStor } if version == 2 { - log.Infof("upgrading event index from version 1 to version 2") + log.Infof("upgrading event index from version 2 to version 3") - // 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 {