Commit
2ee4ee2bb666835c41019b475dd2e286604bdd35 changed PDH lookup
queries to sort on trash_at, which can be slow without an index.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>
--- /dev/null
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+class AddPdhAndTrashIndexToCollections < ActiveRecord::Migration
+ def change
+ add_index :collections, [:portable_data_hash, :trash_at]
+ end
+end
CREATE INDEX index_collections_on_portable_data_hash ON public.collections USING btree (portable_data_hash);
+--
+-- Name: index_collections_on_portable_data_hash_and_trash_at; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_collections_on_portable_data_hash_and_trash_at ON public.collections USING btree (portable_data_hash, trash_at);
+
+
--
-- Name: index_collections_on_trash_at; Type: INDEX; Schema: public; Owner: -
--
INSERT INTO schema_migrations (version) VALUES ('20180806133039');
+INSERT INTO schema_migrations (version) VALUES ('20180820130357');
+