[arvados] created: 2.6.0-55-gb4dbb5352
git repository hosting
git at public.arvados.org
Fri Apr 21 14:39:42 UTC 2023
at b4dbb53529d133660403c1761f06cb321cbc70f6 (commit)
commit b4dbb53529d133660403c1761f06cb321cbc70f6
Author: Tom Clegg <tom at curii.com>
Date: Fri Apr 21 10:38:19 2023 -0400
14070: Add trigram indexes on collections.name and projects.name.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/services/api/db/migrate/20230421142716_add_name_index_to_collections_and_groups.rb b/services/api/db/migrate/20230421142716_add_name_index_to_collections_and_groups.rb
new file mode 100644
index 000000000..5fe450d05
--- /dev/null
+++ b/services/api/db/migrate/20230421142716_add_name_index_to_collections_and_groups.rb
@@ -0,0 +1,14 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+class AddNameIndexToCollectionsAndGroups < ActiveRecord::Migration[5.2]
+ def up
+ ActiveRecord::Base.connection.execute 'CREATE INDEX index_groups_on_name on groups USING gin (name gin_trgm_ops)'
+ ActiveRecord::Base.connection.execute 'CREATE INDEX index_collections_on_name on collections USING gin (name gin_trgm_ops)'
+ end
+ def down
+ ActiveRecord::Base.connection.execute 'DROP INDEX index_collections_on_name'
+ ActiveRecord::Base.connection.execute 'DROP INDEX index_groups_on_name'
+ end
+end
diff --git a/services/api/db/structure.sql b/services/api/db/structure.sql
index 002b470b1..3dd705a80 100644
--- a/services/api/db/structure.sql
+++ b/services/api/db/structure.sql
@@ -1942,6 +1942,13 @@ CREATE INDEX index_collections_on_is_trashed ON public.collections USING btree (
CREATE INDEX index_collections_on_modified_at_and_uuid ON public.collections USING btree (modified_at, uuid);
+--
+-- Name: index_collections_on_name; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_collections_on_name ON public.collections USING gin (name public.gin_trgm_ops);
+
+
--
-- Name: index_collections_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
--
@@ -2131,6 +2138,13 @@ CREATE INDEX index_groups_on_is_trashed ON public.groups USING btree (is_trashed
CREATE INDEX index_groups_on_modified_at_and_uuid ON public.groups USING btree (modified_at, uuid);
+--
+-- Name: index_groups_on_name; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_groups_on_name ON public.groups USING gin (name public.gin_trgm_ops);
+
+
--
-- Name: index_groups_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
--
@@ -3187,6 +3201,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20220726034131'),
('20220804133317'),
('20221219165512'),
-('20221230155924');
+('20221230155924'),
+('20230421142716');
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list