[ARVADOS] created: 1.2.0-32-g28cc107d7

Git user git at public.curoverse.com
Mon Aug 20 09:36:54 EDT 2018


        at  28cc107d70f7fc6fd05435a49352ac0bcb377657 (commit)


commit 28cc107d70f7fc6fd05435a49352ac0bcb377657
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Mon Aug 20 09:36:36 2018 -0400

    14008: Add index to speed up dispatcher queries.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/services/api/db/migrate/20180820132617_add_lock_index_to_containers.rb b/services/api/db/migrate/20180820132617_add_lock_index_to_containers.rb
new file mode 100644
index 000000000..c5d5d7005
--- /dev/null
+++ b/services/api/db/migrate/20180820132617_add_lock_index_to_containers.rb
@@ -0,0 +1,9 @@
+class AddLockIndexToContainers < ActiveRecord::Migration
+  def change
+    # For the current code in sdk/go/dispatch:
+    add_index :containers, [:locked_by_uuid, :priority]
+    # For future dispatchers that use filters instead of offset for
+    # more predictable paging:
+    add_index :containers, [:locked_by_uuid, :uuid]
+  end
+end
diff --git a/services/api/db/structure.sql b/services/api/db/structure.sql
index 12158e51b..67f5b21b5 100644
--- a/services/api/db/structure.sql
+++ b/services/api/db/structure.sql
@@ -1900,6 +1900,20 @@ CREATE INDEX index_containers_on_auth_uuid ON public.containers USING btree (aut
 
 
 --
+-- Name: index_containers_on_locked_by_uuid_and_priority; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_containers_on_locked_by_uuid_and_priority ON public.containers USING btree (locked_by_uuid, priority);
+
+
+--
+-- Name: index_containers_on_locked_by_uuid_and_uuid; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_containers_on_locked_by_uuid_and_uuid ON public.containers USING btree (locked_by_uuid, uuid);
+
+
+--
 -- Name: index_containers_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
@@ -3121,3 +3135,5 @@ INSERT INTO schema_migrations (version) VALUES ('20180608123145');
 
 INSERT INTO schema_migrations (version) VALUES ('20180806133039');
 
+INSERT INTO schema_migrations (version) VALUES ('20180820132617');
+

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list