18943: add modified_at descending index
[arvados.git] / services / api / db / structure.sql
index d874bce9405a6b2311d91642199801d008500a18..9c08b81e0e41d7cc6832eca094915052ad3f20bc 100644 (file)
@@ -1911,6 +1911,13 @@ 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: -
 --
@@ -1932,18 +1939,11 @@ CREATE INDEX index_collections_on_delete_at ON public.collections USING btree (d
 CREATE INDEX index_collections_on_is_trashed ON public.collections USING btree (is_trashed);
 
 
---
--- Name: index_collections_on_modified_at; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_collections_on_modified_at ON public.collections USING btree (modified_at);
-
-
 --
 -- Name: index_collections_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_collections_on_modified_at_uuid ON public.collections USING btree (modified_at DESC, uuid);
+CREATE INDEX index_collections_on_modified_at_uuid ON public.collections USING btree (modified_at DESC, uuid DESC);
 
 
 --
@@ -1988,11 +1988,18 @@ CREATE UNIQUE INDEX index_collections_on_uuid ON public.collections USING btree
 CREATE INDEX index_container_requests_on_container_uuid ON public.container_requests USING btree (container_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_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_container_requests_on_modified_at_uuid ON public.container_requests USING btree (modified_at DESC, uuid);
+CREATE INDEX index_container_requests_on_modified_at_uuid ON public.container_requests USING btree (modified_at DESC, uuid DESC);
 
 
 --
@@ -2100,6 +2107,13 @@ 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: -
 --
@@ -2121,18 +2135,11 @@ CREATE INDEX index_groups_on_group_class ON public.groups USING btree (group_cla
 CREATE INDEX index_groups_on_is_trashed ON public.groups USING btree (is_trashed);
 
 
---
--- Name: index_groups_on_modified_at; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_groups_on_modified_at ON public.groups USING btree (modified_at);
-
-
 --
 -- Name: index_groups_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_groups_on_modified_at_uuid ON public.groups USING btree (modified_at DESC, uuid);
+CREATE INDEX index_groups_on_modified_at_uuid ON public.groups USING btree (modified_at DESC, uuid DESC);
 
 
 --
@@ -2367,24 +2374,24 @@ CREATE INDEX index_links_on_created_at_and_uuid ON public.links USING btree (cre
 
 
 --
--- Name: index_links_on_head_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_links_on_created_at_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_links_on_head_uuid ON public.links USING btree (head_uuid);
+CREATE INDEX index_links_on_created_at_uuid ON public.links USING btree (created_at, uuid);
 
 
 --
--- Name: index_links_on_modified_at; Type: INDEX; Schema: public; Owner: -
+-- Name: index_links_on_head_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_links_on_modified_at ON public.links USING btree (modified_at);
+CREATE INDEX index_links_on_head_uuid ON public.links USING btree (head_uuid);
 
 
 --
 -- Name: index_links_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_links_on_modified_at_uuid ON public.links USING btree (modified_at DESC, uuid);
+CREATE INDEX index_links_on_modified_at_uuid ON public.links USING btree (modified_at DESC, uuid DESC);
 
 
 --
@@ -2430,31 +2437,31 @@ CREATE INDEX index_logs_on_created_at_and_uuid ON public.logs USING btree (creat
 
 
 --
--- Name: index_logs_on_event_at; Type: INDEX; Schema: public; Owner: -
+-- Name: index_logs_on_created_at_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_logs_on_event_at ON public.logs USING btree (event_at);
+CREATE INDEX index_logs_on_created_at_uuid ON public.logs USING btree (created_at, uuid);
 
 
 --
--- Name: index_logs_on_event_type; Type: INDEX; Schema: public; Owner: -
+-- Name: index_logs_on_event_at; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_logs_on_event_type ON public.logs USING btree (event_type);
+CREATE INDEX index_logs_on_event_at ON public.logs USING btree (event_at);
 
 
 --
--- Name: index_logs_on_modified_at; Type: INDEX; Schema: public; Owner: -
+-- Name: index_logs_on_event_type; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_logs_on_modified_at ON public.logs USING btree (modified_at);
+CREATE INDEX index_logs_on_event_type ON public.logs USING btree (event_type);
 
 
 --
 -- Name: index_logs_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_logs_on_modified_at_uuid ON public.logs USING btree (modified_at DESC, uuid);
+CREATE INDEX index_logs_on_modified_at_uuid ON public.logs USING btree (modified_at DESC, uuid DESC);
 
 
 --
@@ -2604,11 +2611,18 @@ CREATE INDEX index_pipeline_templates_on_owner_uuid ON public.pipeline_templates
 CREATE UNIQUE INDEX index_pipeline_templates_on_uuid ON public.pipeline_templates USING btree (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_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_repositories_on_modified_at_uuid ON public.repositories USING btree (modified_at DESC, uuid);
+CREATE INDEX index_repositories_on_modified_at_uuid ON public.repositories USING btree (modified_at DESC, uuid DESC);
 
 
 --
@@ -2696,24 +2710,24 @@ CREATE INDEX index_users_on_created_at_and_uuid ON public.users USING btree (cre
 
 
 --
--- Name: index_users_on_identity_url; Type: INDEX; Schema: public; Owner: -
+-- Name: index_users_on_created_at_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE UNIQUE INDEX index_users_on_identity_url ON public.users USING btree (identity_url);
+CREATE INDEX index_users_on_created_at_uuid ON public.users USING btree (created_at, uuid);
 
 
 --
--- Name: index_users_on_modified_at; Type: INDEX; Schema: public; Owner: -
+-- Name: index_users_on_identity_url; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_users_on_modified_at ON public.users USING btree (modified_at);
+CREATE UNIQUE INDEX index_users_on_identity_url ON public.users USING btree (identity_url);
 
 
 --
 -- Name: index_users_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_users_on_modified_at_uuid ON public.users USING btree (modified_at DESC, uuid);
+CREATE INDEX index_users_on_modified_at_uuid ON public.users USING btree (modified_at DESC, uuid DESC);
 
 
 --
@@ -2737,6 +2751,13 @@ CREATE UNIQUE INDEX index_users_on_username ON public.users USING btree (usernam
 CREATE UNIQUE INDEX index_users_on_uuid ON public.users USING btree (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: -
 --
@@ -2748,7 +2769,7 @@ CREATE INDEX index_virtual_machines_on_hostname ON public.virtual_machines USING
 -- Name: index_virtual_machines_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_virtual_machines_on_modified_at_uuid ON public.virtual_machines USING btree (modified_at DESC, uuid);
+CREATE INDEX index_virtual_machines_on_modified_at_uuid ON public.virtual_machines USING btree (modified_at DESC, uuid DESC);
 
 
 --
@@ -2765,11 +2786,18 @@ CREATE INDEX index_virtual_machines_on_owner_uuid ON public.virtual_machines USI
 CREATE UNIQUE INDEX index_virtual_machines_on_uuid ON public.virtual_machines USING btree (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_uuid; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX index_workflows_on_modified_at_uuid ON public.workflows USING btree (modified_at DESC, uuid);
+CREATE INDEX index_workflows_on_modified_at_uuid ON public.workflows USING btree (modified_at DESC, uuid DESC);
 
 
 --