diff --git a/db/src/main/resources/sql/er_diagram/brief_er_diagram.html b/db/src/main/resources/sql/er_diagram/brief_er_diagram.html index 04beb10b2..1fd0e5614 100644 --- a/db/src/main/resources/sql/er_diagram/brief_er_diagram.html +++ b/db/src/main/resources/sql/er_diagram/brief_er_diagram.html @@ -261,15 +261,11 @@ td.section { generated on -<<<<<<< HEAD - 2021-08-10 20:50:09.993881 -======= - 2021-08-11 23:54:56.914311 ->>>>>>> 475839855 (Add the domain DNS refresh request time field to the DB schema) + 2021-09-14 16:11:21.688911 last flyway file - V101__domain_add_dns_refresh_request_time.sql + V102__add_indexes_to_domain_history_sub_tables.sql @@ -288,11 +284,7 @@ td.section { generated on -<<<<<<< HEAD - 2021-08-10 20:50:09.993881 -======= - 2021-08-11 23:54:56.914311 ->>>>>>> 475839855 (Add the domain DNS refresh request time field to the DB schema) + 2021-09-14 16:11:21.688911 diff --git a/db/src/main/resources/sql/er_diagram/full_er_diagram.html b/db/src/main/resources/sql/er_diagram/full_er_diagram.html index ac96690e2..e9a088edb 100644 --- a/db/src/main/resources/sql/er_diagram/full_er_diagram.html +++ b/db/src/main/resources/sql/er_diagram/full_er_diagram.html @@ -261,15 +261,11 @@ td.section { generated on -<<<<<<< HEAD - 2021-08-10 20:50:07.996141 -======= - 2021-08-11 23:54:54.724849 ->>>>>>> 475839855 (Add the domain DNS refresh request time field to the DB schema) + 2021-09-14 16:11:19.580097 last flyway file - V101__domain_add_dns_refresh_request_time.sql + V102__add_indexes_to_domain_history_sub_tables.sql @@ -288,11 +284,7 @@ td.section { generated on -<<<<<<< HEAD - 2021-08-10 20:50:07.996141 -======= - 2021-08-11 23:54:54.724849 ->>>>>>> 475839855 (Add the domain DNS refresh request time field to the DB schema) + 2021-09-14 16:11:19.580097 @@ -9732,6 +9724,23 @@ td.section { ds_data_history_revision_id ascending + + + + + domain_history_to_ds_data_history_idx + [non-unique index] + + + + domain_repo_id + ascending + + + + domain_history_revision_id + ascending +

 

@@ -10627,6 +10636,23 @@ td.section { id ascending + + + + + domain_history_to_transaction_record_idx + [non-unique index] + + + + domain_repo_id + ascending + + + + history_revision_id + ascending +

 

diff --git a/db/src/main/resources/sql/flyway.txt b/db/src/main/resources/sql/flyway.txt index 1e0714db6..9ea9f5196 100644 --- a/db/src/main/resources/sql/flyway.txt +++ b/db/src/main/resources/sql/flyway.txt @@ -99,3 +99,4 @@ V98__add_last_expiring_cert_notification_sent_date.sql V99__drop_kms_secret_table.sql V100__database_migration_schedule.sql V101__domain_add_dns_refresh_request_time.sql +V102__add_indexes_to_domain_history_sub_tables.sql diff --git a/db/src/main/resources/sql/flyway/V102__add_indexes_to_domain_history_sub_tables.sql b/db/src/main/resources/sql/flyway/V102__add_indexes_to_domain_history_sub_tables.sql new file mode 100644 index 000000000..f586ae7af --- /dev/null +++ b/db/src/main/resources/sql/flyway/V102__add_indexes_to_domain_history_sub_tables.sql @@ -0,0 +1,19 @@ +-- Copyright 2021 The Nomulus Authors. All Rights Reserved. +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +CREATE INDEX IF NOT EXISTS domain_history_to_transaction_record_idx + ON "DomainTransactionRecord" (domain_repo_id, history_revision_id); + +CREATE INDEX IF NOT EXISTS domain_history_to_ds_data_history_idx + ON "DomainDsDataHistory" (domain_repo_id, domain_history_revision_id); diff --git a/db/src/main/resources/sql/schema/nomulus.golden.sql b/db/src/main/resources/sql/schema/nomulus.golden.sql index 82ea8e334..d11e46c77 100644 --- a/db/src/main/resources/sql/schema/nomulus.golden.sql +++ b/db/src/main/resources/sql/schema/nomulus.golden.sql @@ -1489,6 +1489,20 @@ CREATE UNIQUE INDEX database_migration_state_schedule_singleton ON public."Datab CREATE INDEX domain_dns_refresh_request_time_idx ON public."Domain" USING btree (dns_refresh_request_time); +-- +-- Name: domain_history_to_ds_data_history_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX domain_history_to_ds_data_history_idx ON public."DomainDsDataHistory" USING btree (domain_repo_id, domain_history_revision_id); + + +-- +-- Name: domain_history_to_transaction_record_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX domain_history_to_transaction_record_idx ON public."DomainTransactionRecord" USING btree (domain_repo_id, history_revision_id); + + -- -- Name: idx1iy7njgb7wjmj9piml4l2g0qi; Type: INDEX; Schema: public; Owner: - --