migrations: add index on package_version_states(module_path, version)

There is a FK from package_version_states which references
module_version_states (module_path, version). Add an index to improve
performance.

Change-Id: Id7dec927df7c8d91c95c25a50fa4b4274891a965
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/724416
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
This commit is contained in:
Julie Qiu 2020-04-22 08:31:25 -04:00 коммит произвёл Julie Qiu
Родитель cda440f0c4
Коммит 8092390a55
2 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,9 @@
-- Copyright 2020 The Go Authors. All rights reserved.
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE file.
BEGIN;
DROP INDEX idx_package_version_states_module_path_version;
END;

Просмотреть файл

@ -0,0 +1,10 @@
-- Copyright 2020 The Go Authors. All rights reserved.
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE file.
BEGIN;
CREATE INDEX idx_package_version_states_module_path_version
ON package_version_states (module_path, version);
END;