[ARVADOS] created: 1.2.0-32-g5e2ee1067

Git user git at public.curoverse.com
Mon Aug 20 09:24:03 EDT 2018


        at  5e2ee106750fb6413ebc463e6c9e7c87cf624780 (commit)


commit 5e2ee106750fb6413ebc463e6c9e7c87cf624780
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Mon Aug 20 09:17:26 2018 -0400

    13924: Add index for PDH lookups.
    
    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 at veritasgenetics.com>

diff --git a/services/api/db/migrate/20180820130357_add_pdh_and_trash_index_to_collections.rb b/services/api/db/migrate/20180820130357_add_pdh_and_trash_index_to_collections.rb
new file mode 100644
index 000000000..1059cd120
--- /dev/null
+++ b/services/api/db/migrate/20180820130357_add_pdh_and_trash_index_to_collections.rb
@@ -0,0 +1,5 @@
+class AddPdhAndTrashIndexToCollections < ActiveRecord::Migration
+  def change
+    add_index :collections, [:portable_data_hash, :trash_at]
+  end
+end
diff --git a/services/api/db/structure.sql b/services/api/db/structure.sql
index 12158e51b..d2187514a 100644
--- a/services/api/db/structure.sql
+++ b/services/api/db/structure.sql
@@ -1830,6 +1830,13 @@ CREATE INDEX index_collections_on_portable_data_hash ON public.collections USING
 
 
 --
+-- 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: -
 --
 
@@ -3121,3 +3128,5 @@ INSERT INTO schema_migrations (version) VALUES ('20180608123145');
 
 INSERT INTO schema_migrations (version) VALUES ('20180806133039');
 
+INSERT INTO schema_migrations (version) VALUES ('20180820130357');
+

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list