[ARVADOS] updated: 2.1.0-2202-g06c2fb95a

Git user git at public.arvados.org
Fri Apr 1 21:08:10 UTC 2022


Summary of changes:
 services/api/app/models/arvados_model.rb           |  2 +-
 .../20220401153101_fix_created_at_indexes.rb       |  4 +-
 services/api/db/structure.sql                      | 81 +++-------------------
 3 files changed, 13 insertions(+), 74 deletions(-)

       via  06c2fb95a229a00a3a39ac84db60062c94fe8f32 (commit)
       via  1a18f825a86563252e242d479791821941b8cee8 (commit)
       via  5239de634d8c3277024be6e1c1bf1dc049d2bdf0 (commit)
      from  d9cae745245c22e6b4acb0d2ab3f4f3c2afa81fa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 06c2fb95a229a00a3a39ac84db60062c94fe8f32
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Fri Apr 1 17:07:43 2022 -0400

    18943: Drop redundant indexes
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/services/api/db/migrate/20220401153101_fix_created_at_indexes.rb b/services/api/db/migrate/20220401153101_fix_created_at_indexes.rb
index 5908ab4bc..35ed4cd15 100644
--- a/services/api/db/migrate/20220401153101_fix_created_at_indexes.rb
+++ b/services/api/db/migrate/20220401153101_fix_created_at_indexes.rb
@@ -8,6 +8,7 @@ class FixCreatedAtIndexes < ActiveRecord::Migration[5.2]
   def up
     @@idxtables.each do |table|
       ActiveRecord::Base.connection.execute("DROP INDEX IF EXISTS index_#{table.to_s}_on_created_at")
+      ActiveRecord::Base.connection.execute("DROP INDEX IF EXISTS index_#{table.to_s}_on_created_at_uuid")
       ActiveRecord::Base.connection.execute("DROP INDEX IF EXISTS index_#{table.to_s}_on_created_at_and_uuid")
       ActiveRecord::Base.connection.execute("DROP INDEX IF EXISTS index_#{table.to_s}_on_modified_at")
       ActiveRecord::Base.connection.execute("DROP INDEX IF EXISTS index_#{table.to_s}_on_modified_at_uuid")
@@ -21,6 +22,7 @@ class FixCreatedAtIndexes < ActiveRecord::Migration[5.2]
   def down
     @@idxtables.each do |table|
       ActiveRecord::Base.connection.execute("DROP INDEX IF EXISTS index_#{table.to_s}_on_created_at")
+      ActiveRecord::Base.connection.execute("DROP INDEX IF EXISTS index_#{table.to_s}_on_created_at_uuid")
       ActiveRecord::Base.connection.execute("DROP INDEX IF EXISTS index_#{table.to_s}_on_created_at_and_uuid")
       ActiveRecord::Base.connection.execute("DROP INDEX IF EXISTS index_#{table.to_s}_on_modified_at")
       ActiveRecord::Base.connection.execute("DROP INDEX IF EXISTS index_#{table.to_s}_on_modified_at_uuid")
diff --git a/services/api/db/structure.sql b/services/api/db/structure.sql
index 2858bba4f..e6bba6762 100644
--- a/services/api/db/structure.sql
+++ b/services/api/db/structure.sql
@@ -1911,13 +1911,6 @@ CREATE UNIQUE INDEX index_authorized_keys_on_uuid ON public.authorized_keys USIN
 CREATE INDEX index_collections_on_created_at_and_uuid ON public.collections USING btree (created_at, uuid);
 
 
---
--- Name: index_collections_on_created_at_uuid; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_collections_on_created_at_uuid ON public.collections USING btree (created_at, uuid);
-
-
 --
 -- Name: index_collections_on_current_version_uuid_and_version; Type: INDEX; Schema: public; Owner: -
 --
@@ -1995,13 +1988,6 @@ CREATE INDEX index_container_requests_on_container_uuid ON public.container_requ
 CREATE INDEX index_container_requests_on_created_at_and_uuid ON public.container_requests USING btree (created_at, uuid);
 
 
---
--- Name: index_container_requests_on_created_at_uuid; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_container_requests_on_created_at_uuid ON public.container_requests USING btree (created_at, uuid);
-
-
 --
 -- Name: index_container_requests_on_modified_at_and_uuid; Type: INDEX; Schema: public; Owner: -
 --
@@ -2114,13 +2100,6 @@ CREATE UNIQUE INDEX index_frozen_groups_on_uuid ON public.frozen_groups USING bt
 CREATE INDEX index_groups_on_created_at_and_uuid ON public.groups USING btree (created_at, uuid);
 
 
---
--- Name: index_groups_on_created_at_uuid; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_groups_on_created_at_uuid ON public.groups USING btree (created_at, uuid);
-
-
 --
 -- Name: index_groups_on_delete_at; Type: INDEX; Schema: public; Owner: -
 --
@@ -2380,13 +2359,6 @@ CREATE UNIQUE INDEX index_keep_services_on_uuid ON public.keep_services USING bt
 CREATE INDEX index_links_on_created_at_and_uuid ON public.links USING btree (created_at, uuid);
 
 
---
--- Name: index_links_on_created_at_uuid; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_links_on_created_at_uuid ON public.links USING btree (created_at, uuid);
-
-
 --
 -- Name: index_links_on_head_uuid; Type: INDEX; Schema: public; Owner: -
 --
@@ -2443,13 +2415,6 @@ CREATE UNIQUE INDEX index_links_on_uuid ON public.links USING btree (uuid);
 CREATE INDEX index_logs_on_created_at_and_uuid ON public.logs USING btree (created_at, uuid);
 
 
---
--- Name: index_logs_on_created_at_uuid; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_logs_on_created_at_uuid ON public.logs USING btree (created_at, uuid);
-
-
 --
 -- Name: index_logs_on_event_at; Type: INDEX; Schema: public; Owner: -
 --
@@ -2625,13 +2590,6 @@ CREATE UNIQUE INDEX index_pipeline_templates_on_uuid ON public.pipeline_template
 CREATE INDEX index_repositories_on_created_at_and_uuid ON public.repositories USING btree (created_at, uuid);
 
 
---
--- Name: index_repositories_on_created_at_uuid; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_repositories_on_created_at_uuid ON public.repositories USING btree (created_at, uuid);
-
-
 --
 -- Name: index_repositories_on_modified_at_and_uuid; Type: INDEX; Schema: public; Owner: -
 --
@@ -2723,13 +2681,6 @@ CREATE UNIQUE INDEX index_trashed_groups_on_group_uuid ON public.trashed_groups
 CREATE INDEX index_users_on_created_at_and_uuid ON public.users USING btree (created_at, uuid);
 
 
---
--- Name: index_users_on_created_at_uuid; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_users_on_created_at_uuid ON public.users USING btree (created_at, uuid);
-
-
 --
 -- Name: index_users_on_identity_url; Type: INDEX; Schema: public; Owner: -
 --
@@ -2772,13 +2723,6 @@ CREATE UNIQUE INDEX index_users_on_uuid ON public.users USING btree (uuid);
 CREATE INDEX index_virtual_machines_on_created_at_and_uuid ON public.virtual_machines USING btree (created_at, uuid);
 
 
---
--- Name: index_virtual_machines_on_created_at_uuid; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_virtual_machines_on_created_at_uuid ON public.virtual_machines USING btree (created_at, uuid);
-
-
 --
 -- Name: index_virtual_machines_on_hostname; Type: INDEX; Schema: public; Owner: -
 --
@@ -2814,13 +2758,6 @@ CREATE UNIQUE INDEX index_virtual_machines_on_uuid ON public.virtual_machines US
 CREATE INDEX index_workflows_on_created_at_and_uuid ON public.workflows USING btree (created_at, uuid);
 
 
---
--- Name: index_workflows_on_created_at_uuid; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_workflows_on_created_at_uuid ON public.workflows USING btree (created_at, uuid);
-
-
 --
 -- Name: index_workflows_on_modified_at_and_uuid; Type: INDEX; Schema: public; Owner: -
 --

commit 1a18f825a86563252e242d479791821941b8cee8
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Fri Apr 1 17:03:44 2022 -0400

    18943: modified_by index doesn't need to be (desc, desc)
    
    Can use an (asc, asc) index for a (desc, desc) "order by".
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/services/api/db/migrate/20220401153101_fix_created_at_indexes.rb b/services/api/db/migrate/20220401153101_fix_created_at_indexes.rb
index 308e69c9b..5908ab4bc 100644
--- a/services/api/db/migrate/20220401153101_fix_created_at_indexes.rb
+++ b/services/api/db/migrate/20220401153101_fix_created_at_indexes.rb
@@ -14,7 +14,7 @@ class FixCreatedAtIndexes < ActiveRecord::Migration[5.2]
       ActiveRecord::Base.connection.execute("DROP INDEX IF EXISTS index_#{table.to_s}_on_modified_at_and_uuid")
 
       ActiveRecord::Base.connection.execute("CREATE INDEX IF NOT EXISTS index_#{table.to_s}_on_created_at_and_uuid ON #{table.to_s} USING btree (created_at, uuid)")
-      ActiveRecord::Base.connection.execute("CREATE INDEX IF NOT EXISTS index_#{table.to_s}_on_modified_at_and_uuid ON #{table.to_s} USING btree (modified_at desc, uuid desc)")
+      ActiveRecord::Base.connection.execute("CREATE INDEX IF NOT EXISTS index_#{table.to_s}_on_modified_at_and_uuid ON #{table.to_s} USING btree (modified_at, uuid)")
     end
   end
 
diff --git a/services/api/db/structure.sql b/services/api/db/structure.sql
index 8cb27ab4d..2858bba4f 100644
--- a/services/api/db/structure.sql
+++ b/services/api/db/structure.sql
@@ -1943,7 +1943,7 @@ CREATE INDEX index_collections_on_is_trashed ON public.collections USING btree (
 -- Name: index_collections_on_modified_at_and_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_collections_on_modified_at_and_uuid ON public.collections USING btree (modified_at DESC, uuid DESC);
+CREATE INDEX index_collections_on_modified_at_and_uuid ON public.collections USING btree (modified_at, uuid);
 
 
 --
@@ -2006,7 +2006,7 @@ CREATE INDEX index_container_requests_on_created_at_uuid ON public.container_req
 -- Name: index_container_requests_on_modified_at_and_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_container_requests_on_modified_at_and_uuid ON public.container_requests USING btree (modified_at DESC, uuid DESC);
+CREATE INDEX index_container_requests_on_modified_at_and_uuid ON public.container_requests USING btree (modified_at, uuid);
 
 
 --
@@ -2146,7 +2146,7 @@ CREATE INDEX index_groups_on_is_trashed ON public.groups USING btree (is_trashed
 -- Name: index_groups_on_modified_at_and_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_groups_on_modified_at_and_uuid ON public.groups USING btree (modified_at DESC, uuid DESC);
+CREATE INDEX index_groups_on_modified_at_and_uuid ON public.groups USING btree (modified_at, uuid);
 
 
 --
@@ -2398,7 +2398,7 @@ CREATE INDEX index_links_on_head_uuid ON public.links USING btree (head_uuid);
 -- Name: index_links_on_modified_at_and_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_links_on_modified_at_and_uuid ON public.links USING btree (modified_at DESC, uuid DESC);
+CREATE INDEX index_links_on_modified_at_and_uuid ON public.links USING btree (modified_at, uuid);
 
 
 --
@@ -2468,7 +2468,7 @@ CREATE INDEX index_logs_on_event_type ON public.logs USING btree (event_type);
 -- Name: index_logs_on_modified_at_and_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_logs_on_modified_at_and_uuid ON public.logs USING btree (modified_at DESC, uuid DESC);
+CREATE INDEX index_logs_on_modified_at_and_uuid ON public.logs USING btree (modified_at, uuid);
 
 
 --
@@ -2636,7 +2636,7 @@ CREATE INDEX index_repositories_on_created_at_uuid ON public.repositories USING
 -- Name: index_repositories_on_modified_at_and_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_repositories_on_modified_at_and_uuid ON public.repositories USING btree (modified_at DESC, uuid DESC);
+CREATE INDEX index_repositories_on_modified_at_and_uuid ON public.repositories USING btree (modified_at, uuid);
 
 
 --
@@ -2741,7 +2741,7 @@ CREATE UNIQUE INDEX index_users_on_identity_url ON public.users USING btree (ide
 -- Name: index_users_on_modified_at_and_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_users_on_modified_at_and_uuid ON public.users USING btree (modified_at DESC, uuid DESC);
+CREATE INDEX index_users_on_modified_at_and_uuid ON public.users USING btree (modified_at, uuid);
 
 
 --
@@ -2790,7 +2790,7 @@ CREATE INDEX index_virtual_machines_on_hostname ON public.virtual_machines USING
 -- Name: index_virtual_machines_on_modified_at_and_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_virtual_machines_on_modified_at_and_uuid ON public.virtual_machines USING btree (modified_at DESC, uuid DESC);
+CREATE INDEX index_virtual_machines_on_modified_at_and_uuid ON public.virtual_machines USING btree (modified_at, uuid);
 
 
 --
@@ -2825,7 +2825,7 @@ CREATE INDEX index_workflows_on_created_at_uuid ON public.workflows USING btree
 -- Name: index_workflows_on_modified_at_and_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_workflows_on_modified_at_and_uuid ON public.workflows USING btree (modified_at DESC, uuid DESC);
+CREATE INDEX index_workflows_on_modified_at_and_uuid ON public.workflows USING btree (modified_at, uuid);
 
 
 --

commit 5239de634d8c3277024be6e1c1bf1dc049d2bdf0
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Fri Apr 1 16:50:46 2022 -0400

    18943: Adjust default ordering of results to account for index order
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb
index 327bf63b5..07a31d81a 100644
--- a/services/api/app/models/arvados_model.rb
+++ b/services/api/app/models/arvados_model.rb
@@ -220,7 +220,7 @@ class ArvadosModel < ApplicationRecord
   end
 
   def self.default_orders
-    ["#{table_name}.modified_at desc", "#{table_name}.uuid"]
+    ["#{table_name}.modified_at desc", "#{table_name}.uuid desc"]
   end
 
   def self.unique_columns

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list