diff --git a/core/src/main/java/google/registry/model/host/HostResource.java b/core/src/main/java/google/registry/model/host/HostResource.java index a1c876490..a6dbee862 100644 --- a/core/src/main/java/google/registry/model/host/HostResource.java +++ b/core/src/main/java/google/registry/model/host/HostResource.java @@ -47,7 +47,12 @@ import javax.persistence.AccessType; * would prevent us from using JPA standard bootstrapping). For now, there is no obvious benefit * doing either. */ - indexes = {@javax.persistence.Index(columnList = "hostName")}) + indexes = { + @javax.persistence.Index(columnList = "hostName"), + @javax.persistence.Index(columnList = "creationTime"), + @javax.persistence.Index(columnList = "deletionTime"), + @javax.persistence.Index(columnList = "currentSponsorRegistrarId") + }) @ExternalMessagingName("host") @WithStringVKey @Access(AccessType.FIELD) // otherwise it'll use the default if the repoId (property) 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 c326612b6..32832528c 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,11 +261,11 @@ td.section { generated on - 2022-03-14 17:59:45.688046 + 2022-03-15 20:34:15.683737 last flyway file - V112__add_billingrecurrence_missing_indexes.sql + V113__add_host_missing_indexes.sql @@ -284,7 +284,7 @@ td.section { generated on - 2022-03-14 17:59:45.688046 + 2022-03-15 20:34:15.683737 @@ -503,246 +503,246 @@ td.section { domainhistory_a54cc226 - - + + public.DomainHistory - - + + [table] - + history_revision_id - + - + int8 not null - + history_registrar_id - + - + text - + history_modification_time - + - + timestamptz not null - + history_type - + - + text not null - + creation_time - + - + timestamptz - + domain_repo_id - + - + text not null - + billingevent_a57d1815:w->domainhistory_a54cc226:e - + - - - - + + + + fk_billing_event_domain_history billingevent_a57d1815:w->domainhistory_a54cc226:e - + - - - - + + + + fk_billing_event_domain_history billingevent_a57d1815:w->domainhistory_a54cc226:e - + - - - - + + + + fk_billing_event_recurrence_history billingevent_a57d1815:w->domainhistory_a54cc226:e - + - - - - + + + + fk_billing_event_recurrence_history registrar_6e1503e3 - - + + public.Registrar - - + + [table] - + registrar_id - + - + text not null - + iana_identifier - + - + int8 - + registrar_name - + - + text not null - + billingevent_a57d1815:w->registrar_6e1503e3:e - + - - - - + + + + fk_billing_event_registrar_id billingcancellation_6eedf614 - - + + public.BillingCancellation - - + + [table] - + billing_cancellation_id - + - + int8 not null - + registrar_id - + - + text not null - + domain_history_revision_id - + - + int8 not null - + domain_repo_id - + - + text not null - + event_time - + - + timestamptz not null - + billing_time - + - + timestamptz - + billing_event_id - + - + int8 - + billing_recurrence_id - + - + int8 - + billingcancellation_6eedf614:w->billingevent_a57d1815:e - - - + + + @@ -753,233 +753,233 @@ td.section { billingcancellation_6eedf614:w->billingrecurrence_5fa2cb01:e - - - + + + - + fk_billing_cancellation_billing_recurrence_id billingcancellation_6eedf614:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk_billing_cancellation_domain_history billingcancellation_6eedf614:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk_billing_cancellation_domain_history billingcancellation_6eedf614:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_billing_cancellation_registrar_id domain_6c51cffa - - + + public.Domain - - + + [table] - + repo_id - + - + text not null - + creation_registrar_id - + - + text not null - + creation_time - + - + timestamptz not null - + current_sponsor_registrar_id - + - + text not null - + deletion_time - + - + timestamptz - + last_epp_update_registrar_id - + - + text - + domain_name - + - + text - + tld - + - + text - + admin_contact - + - + text - + billing_contact - + - + text - + registrant_contact - + - + text - + tech_contact - + - + text - + transfer_billing_cancellation_id - + - + int8 - + transfer_billing_event_id - + - + int8 - + transfer_billing_recurrence_id - + - + int8 - + transfer_gaining_registrar_id - + - + text - + transfer_losing_registrar_id - + - + text - + billing_recurrence_id - + - + int8 - + autorenew_end_time - + - + timestamptz - + dns_refresh_request_time - + - + timestamptz - + domain_6c51cffa:w->billingevent_a57d1815:e - - - + + + @@ -990,22 +990,22 @@ td.section { domain_6c51cffa:w->billingcancellation_6eedf614:e - - - - - - - - + + + + + + + + fk_domain_transfer_billing_cancellation_id domain_6c51cffa:w->billingrecurrence_5fa2cb01:e - - - + + + @@ -1016,9 +1016,9 @@ td.section { domain_6c51cffa:w->billingrecurrence_5fa2cb01:e - - - + + + @@ -1029,243 +1029,243 @@ td.section { contact_8de8cb16 - - + + public.Contact - - + + [table] - + repo_id - + - + text not null - + creation_registrar_id - + - + text not null - + creation_time - + - + timestamptz not null - + current_sponsor_registrar_id - + - + text not null - + deletion_time - + - + timestamptz - + last_epp_update_registrar_id - + - + text - + contact_id - + - + text - + search_name - + - + text - + transfer_gaining_registrar_id - + - + text - + transfer_losing_registrar_id - + - + text - + domain_6c51cffa:w->contact_8de8cb16:e - - - - - - - - + + + + + + + + fk_domain_admin_contact domain_6c51cffa:w->contact_8de8cb16:e - - - - - - - - + + + + + + + + fk_domain_billing_contact domain_6c51cffa:w->contact_8de8cb16:e - - - - - - - - + + + + + + + + fk_domain_registrant_contact domain_6c51cffa:w->contact_8de8cb16:e - - - - - - - - + + + + + + + + fk_domain_tech_contact domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk2jc69qyg2tv9hhnmif6oa1cx1 domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk2u3srsfbei272093m3b3xwj23 domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fkjc0r9r5y1lfbt4gpbqw4wsuvq domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_domain_transfer_gaining_registrar_id domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_domain_transfer_losing_registrar_id tld_f1fa57e2 - - + + public.Tld - - + + [table] - + tld_name - + - + text not null - + domain_6c51cffa:w->tld_f1fa57e2:e - - - - - - - - + + + + + + + + fk_domain_tld @@ -1336,13 +1336,13 @@ td.section { graceperiod_cd3b2e8f:w->domain_6c51cffa:e - + - - - - + + + + fk_grace_period_domain_repo_id @@ -1362,52 +1362,52 @@ td.section { graceperiod_cd3b2e8f:w->registrar_6e1503e3:e - + - - - - + + + + fk_grace_period_registrar_id billingrecurrence_5fa2cb01:w->domainhistory_a54cc226:e - + - - - - + + + + fk_billing_recurrence_domain_history billingrecurrence_5fa2cb01:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk_billing_recurrence_domain_history billingrecurrence_5fa2cb01:w->registrar_6e1503e3:e - - - - - - - + + + + + + + fk_billing_recurrence_registrar_id @@ -1480,152 +1480,152 @@ td.section { contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk1sfyj7o7954prbn1exk7lpnoe contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk93c185fx7chn68uv7nl6uv2s0 contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fkmb7tdiv85863134w1wogtxrb2 contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_contact_transfer_gaining_registrar_id contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_contact_transfer_losing_registrar_id contacthistory_d2964f8a - - + + public.ContactHistory - - + + [table] - + history_revision_id - + - + int8 not null - + history_registrar_id - + - + text - + history_modification_time - + - + timestamptz not null - + history_type - + - + text not null - + creation_time - + - + timestamptz - + contact_repo_id - + - + text not null - + contacthistory_d2964f8a:w->contact_8de8cb16:e - - - - - - - - + + + + + + + + fk_contact_history_contact_repo_id contacthistory_d2964f8a:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_contact_history_registrar_id @@ -1731,160 +1731,176 @@ td.section { pollmessage_614a523e:w->domain_6c51cffa:e - + - - - - - - + + + + + + fk_poll_message_domain_repo_id pollmessage_614a523e:w->contact_8de8cb16:e - - - - - - - - + + + + + + + + fk_poll_message_contact_repo_id pollmessage_614a523e:w->contacthistory_d2964f8a:e - + - - - - - + + + + + fk_poll_message_contact_history pollmessage_614a523e:w->contacthistory_d2964f8a:e - + - - - - - + + + + + fk_poll_message_contact_history pollmessage_614a523e:w->domainhistory_a54cc226:e - + - - - - + + + + fk_poll_message_domain_history pollmessage_614a523e:w->domainhistory_a54cc226:e - + - - - - + + + + fk_poll_message_domain_history host_f21b78de - - + + public.Host - - + + [table] - + repo_id - + - + text not null - + creation_registrar_id - + - + text - + + creation_time + + + + + timestamptz + + current_sponsor_registrar_id - + - + text - + + deletion_time + + + + + timestamptz + + last_epp_update_registrar_id - + - + text - + host_name - + - + text - + superordinate_domain - + - + text - + inet_addresses - + - + _text - + pollmessage_614a523e:w->host_f21b78de:e - + - - - - - + + + + + fk_poll_message_host_repo_id @@ -1984,39 +2000,39 @@ td.section { pollmessage_614a523e:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_poll_message_registrar_id pollmessage_614a523e:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_poll_message_transfer_response_gaining_registrar_id pollmessage_614a523e:w->registrar_6e1503e3:e - + - - - - + + + + fk_poll_message_transfer_response_losing_registrar_id @@ -2071,92 +2087,92 @@ td.section { delegationsignerdata_e542a872 - - + + public.DelegationSignerData - - + + [table] - + domain_repo_id - + - + text not null - + key_tag - + - + int4 not null - + algorithm - + - + int4 not null - + digest - + - + bytea not null - + digest_type - + - + int4 not null - + delegationsignerdata_e542a872:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fktr24j9v14ph2mfuw2gsmt12kq domainhistory_a54cc226:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fk_domain_history_domain_repo_id domainhistory_a54cc226:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_domain_history_registrar_id @@ -2190,79 +2206,79 @@ td.section { domainhost_1ea127c2:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fkfmi7bdink53swivs390m2btxg domainhost_1ea127c2:w->host_f21b78de:e - - - - - - - - + + + + + + + + fk_domainhost_host_valid host_f21b78de:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fk_host_superordinate_domain host_f21b78de:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_host_creation_registrar_id host_f21b78de:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_host_current_sponsor_registrar_id host_f21b78de:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_host_last_epp_update_registrar_id @@ -2304,27 +2320,27 @@ td.section { domaindsdatahistory_995b060d:w->domainhistory_a54cc226:e - - + + - - - - + + + + fko4ilgyyfnvppbpuivus565i0j domaindsdatahistory_995b060d:w->domainhistory_a54cc226:e - - + + - - - - - + + + + + fko4ilgyyfnvppbpuivus565i0j @@ -2366,26 +2382,26 @@ td.section { domainhistoryhost_9f3f23ee:w->domainhistory_a54cc226:e - + - - - - - + + + + + fka9woh3hu8gx5x0vly6bai327n domainhistoryhost_9f3f23ee:w->domainhistory_a54cc226:e - - - - - - - + + + + + + + fka9woh3hu8gx5x0vly6bai327n @@ -2441,40 +2457,40 @@ td.section { domaintransactionrecord_6e77ff61:w->domainhistory_a54cc226:e - + - - - - + + + + fkcjqe54u72kha71vkibvxhjye7 domaintransactionrecord_6e77ff61:w->domainhistory_a54cc226:e - + - - - - + + + + fkcjqe54u72kha71vkibvxhjye7 domaintransactionrecord_6e77ff61:w->tld_f1fa57e2:e - - - - - - - - + + + + + + + + fk_domain_transaction_record_tld @@ -2516,53 +2532,53 @@ td.section { graceperiodhistory_40ccc1f1:w->domainhistory_a54cc226:e - + - - - - + + + + fk7w3cx8d55q8bln80e716tr7b8 graceperiodhistory_40ccc1f1:w->domainhistory_a54cc226:e - + - - - - + + + + fk7w3cx8d55q8bln80e716tr7b8 hosthistory_56210c2:w->host_f21b78de:e - - - - - - - - + + + + + + + + fk_hosthistory_host hosthistory_56210c2:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_history_registrar_id @@ -2742,13 +2758,13 @@ td.section { registrarpoc_ab47054d:w->registrar_6e1503e3:e - + - - - - + + + + fk_registrar_poc_registrar_id @@ -5255,11 +5271,21 @@ td.section { creation_registrar_id text + + + creation_time + timestamptz + current_sponsor_registrar_id text + + + deletion_time + timestamptz + last_epp_update_registrar_id 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 f5ef6ae78..658eff033 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,11 +261,11 @@ td.section { generated on - 2022-03-14 17:59:44.31197 + 2022-03-15 20:34:14.292487 last flyway file - V112__add_billingrecurrence_missing_indexes.sql + V113__add_host_missing_indexes.sql @@ -274,19 +274,19 @@ td.section { SchemaCrawler_Diagram - + generated by - + SchemaCrawler 16.10.1 - + generated on - - 2022-03-14 17:59:44.31197 + + 2022-03-15 20:34:14.292487 - + allocationtoken_a08ccbef @@ -11323,6 +11323,18 @@ td.section {
+
+ idxl49vydnq0h5j1piefwjy4i8er + [non-unique index] +
+
+ + current_sponsor_registrar_id + ascending +
+
+ +
idxkpkh68n6dy5v51047yr6b0e9l [non-unique index] @@ -11344,6 +11356,30 @@ td.section { repo_id ascending
+
+ +
+
+ idxy98mebut8ix1v07fjxxdkqcx + [non-unique index] +
+
+ + creation_time + ascending +
+
+ +
+
+ idxovmntef6l45tw2bsfl56tcugx + [non-unique index] +
+
+ + deletion_time + ascending +

 

diff --git a/db/src/main/resources/sql/flyway.txt b/db/src/main/resources/sql/flyway.txt index 1ebcbdfd3..305aad992 100644 --- a/db/src/main/resources/sql/flyway.txt +++ b/db/src/main/resources/sql/flyway.txt @@ -110,3 +110,4 @@ V109__add_domain_host_missing_indexes_from_query_analyzer.sql V110__add_graceperiod_missing_indexes_from_query_analyzer.sql V111__add_billingcancellation_missing_indexes.sql V112__add_billingrecurrence_missing_indexes.sql +V113__add_host_missing_indexes.sql diff --git a/db/src/main/resources/sql/flyway/V113__add_host_missing_indexes.sql b/db/src/main/resources/sql/flyway/V113__add_host_missing_indexes.sql new file mode 100644 index 000000000..cbb099d9e --- /dev/null +++ b/db/src/main/resources/sql/flyway/V113__add_host_missing_indexes.sql @@ -0,0 +1,18 @@ +-- Copyright 2022 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 IDXy98mebut8ix1v07fjxxdkqcx ON "Host" (creation_time); +CREATE INDEX IDXovmntef6l45tw2bsfl56tcugx ON "Host" (deletion_time); +CREATE INDEX IDXl49vydnq0h5j1piefwjy4i8er ON "Host" (current_sponsor_registrar_id); + diff --git a/db/src/main/resources/sql/schema/db-schema.sql.generated b/db/src/main/resources/sql/schema/db-schema.sql.generated index 3362f11cd..209334c42 100644 --- a/db/src/main/resources/sql/schema/db-schema.sql.generated +++ b/db/src/main/resources/sql/schema/db-schema.sql.generated @@ -817,6 +817,9 @@ create index IDXbgssjudpm428mrv0xfpvgifps on "GracePeriod" (billing_event_id); create index IDX5u5m6clpk3nktrvtyy5umacb6 on "GracePeriod" (billing_recurrence_id); create index IDXd01j17vrpjxaerxdmn8bwxs7s on "GracePeriodHistory" (domain_repo_id); create index IDXkpkh68n6dy5v51047yr6b0e9l on "Host" (host_name); +create index IDXy98mebut8ix1v07fjxxdkqcx on "Host" (creation_time); +create index IDXovmntef6l45tw2bsfl56tcugx on "Host" (deletion_time); +create index IDXl49vydnq0h5j1piefwjy4i8er on "Host" (current_sponsor_registrar_id); create index IDXfg2nnjlujxo6cb9fha971bq2n on "HostHistory" (creation_time); create index IDX1iy7njgb7wjmj9piml4l2g0qi on "HostHistory" (history_registrar_id); create index IDXkkwbwcwvrdkkqothkiye4jiff on "HostHistory" (host_name); diff --git a/db/src/main/resources/sql/schema/nomulus.golden.sql b/db/src/main/resources/sql/schema/nomulus.golden.sql index 570f6e536..9b7d7eddf 100644 --- a/db/src/main/resources/sql/schema/nomulus.golden.sql +++ b/db/src/main/resources/sql/schema/nomulus.golden.sql @@ -1798,6 +1798,13 @@ CREATE INDEX idxkpkh68n6dy5v51047yr6b0e9l ON public."Host" USING btree (host_nam CREATE INDEX idxku0fopwyvd57ebo8bf0jg9xo2 ON public."BillingCancellation" USING btree (billing_recurrence_id); +-- +-- Name: idxl49vydnq0h5j1piefwjy4i8er; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX idxl49vydnq0h5j1piefwjy4i8er ON public."Host" USING btree (current_sponsor_registrar_id); + + -- -- Name: idxl8vobbecsd32k4ksavdfx8st6; Type: INDEX; Schema: public; Owner: - -- @@ -1854,6 +1861,13 @@ CREATE INDEX idxoqd7n4hbx86hvlgkilq75olas ON public."Contact" USING btree (conta CREATE INDEX idxoqttafcywwdn41um6kwlt0n8b ON public."BillingRecurrence" USING btree (domain_repo_id); +-- +-- Name: idxovmntef6l45tw2bsfl56tcugx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX idxovmntef6l45tw2bsfl56tcugx ON public."Host" USING btree (deletion_time); + + -- -- Name: idxp3usbtvk0v1m14i5tdp4xnxgc; Type: INDEX; Schema: public; Owner: - -- @@ -1931,6 +1945,13 @@ CREATE INDEX idxsu1nam10cjes9keobapn5jvxj ON public."DomainHistory" USING btree CREATE INDEX idxsudwswtwqnfnx2o1hx4s0k0g5 ON public."ContactHistory" USING btree (history_modification_time); +-- +-- Name: idxy98mebut8ix1v07fjxxdkqcx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX idxy98mebut8ix1v07fjxxdkqcx ON public."Host" USING btree (creation_time); + + -- -- Name: premiumlist_name_idx; Type: INDEX; Schema: public; Owner: - --