From: Peter Amstutz Date: Fri, 1 Apr 2022 21:07:43 +0000 (-0400) Subject: 18943: Drop redundant indexes X-Git-Tag: 2.5.0~229^2~5 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/06c2fb95a229a00a3a39ac84db60062c94fe8f32 18943: Drop redundant indexes Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- 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 5908ab4bc7..35ed4cd152 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 2858bba4f2..e6bba67625 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: - --