diff --git a/management/server/geolocation/store.go b/management/server/geolocation/store.go index 5ab4f110b5f..01a70b25149 100644 --- a/management/server/geolocation/store.go +++ b/management/server/geolocation/store.go @@ -133,5 +133,16 @@ func setupInMemoryDBFromFile(db *gorm.DB, source string) error { return err } + // index geoname_id and country_iso_code field + err = db.Exec("CREATE INDEX idx_geonames_country_iso_code ON geonames(country_iso_code);").Error + if err != nil { + log.Fatal(err) + } + + err = db.Exec("CREATE INDEX idx_geonames_geoname_id ON geonames(geoname_id);").Error + if err != nil { + log.Fatal(err) + } + return nil }