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 42b34723b..8e55e3f4b 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 - 2025-09-29 21:19:42 + 2025-10-10 17:24:50 last flyway file - V209__poll_message_hash.sql + V213__graceperiodhistory_history_revision_id_hash.sql @@ -273,7 +273,7 @@ td.section {

 

- SchemaCrawler_Diagram generated by SchemaCrawler 16.27.1 generated on 2025-09-29 21:19:42 + SchemaCrawler_Diagram generated by SchemaCrawler 16.27.1 generated on 2025-10-10 17:24:50 allocationtoken_a08ccbef public."AllocationToken" [table] token text not null domain_name text redemption_domain_repo_id text token_type text 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 485b58dd6..26bbe8b8d 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 - 2025-09-29 21:19:38 + 2025-10-10 17:24:47
last flyway file - V209__poll_message_hash.sql + V213__graceperiodhistory_history_revision_id_hash.sql
@@ -273,7 +273,7 @@ td.section {

 

- SchemaCrawler_Diagram generated by SchemaCrawler 16.27.1 generated on 2025-09-29 21:19:38 + SchemaCrawler_Diagram generated by SchemaCrawler 16.27.1 generated on 2025-10-10 17:24:47 allocationtoken_a08ccbef public."AllocationToken" [table] token text not null update_timestamp timestamptz allowed_registrar_ids _text allowed_tlds _text creation_time timestamptz not null discount_fraction float8(17, 17) not null discount_premiums bool not null discount_years int4 not null domain_name text redemption_domain_repo_id text token_status_transitions hstore token_type text redemption_domain_history_id int8 renewal_price_behavior text not null registration_behavior text not null allowed_epp_actions _text renewal_price_amount numeric(19, 2) renewal_price_currency text discount_price_amount numeric(19, 2) discount_price_currency text @@ -972,6 +972,18 @@ td.section {
+
+ allocationtoken_token_hash + [non-unique hashed index] +
+
+ + token + unknown +
+
+ +
idx9g3s7mjv1yn4t06nqid39whss [non-unique index] @@ -4846,6 +4858,18 @@ td.section {
+
+ domaindsdatahistory_domain_history_revision_id_hash + [non-unique hashed index] +
+
+ + domain_history_revision_id + unknown +
+
+ +
"DomainDsDataHistory_pkey" [unique index] @@ -5469,6 +5493,18 @@ td.section {
+
+ domainhistoryhost_domain_history_history_revision_id_hash + [non-unique hashed index] +
+
+ + domain_history_history_revision_id + unknown +
+
+ +
idx69qun5kxt3eux5igrxrqcycv0 [non-unique index] @@ -6087,6 +6123,18 @@ td.section {
+
+ graceperiodhistory_domain_history_revision_id_hash + [non-unique hashed index] +
+
+ + domain_history_revision_id + unknown +
+
+ +
"GracePeriodHistory_pkey" [unique index] diff --git a/db/src/main/resources/sql/flyway.txt b/db/src/main/resources/sql/flyway.txt index 12c489e49..51dc75e28 100644 --- a/db/src/main/resources/sql/flyway.txt +++ b/db/src/main/resources/sql/flyway.txt @@ -207,3 +207,7 @@ V206__grace_period_hash.sql V207__grace_period_history_hash.sql V208__host_hash.sql V209__poll_message_hash.sql +V210__allocationtoken_token_hash.sql +V211__domainhistoryhost_history_revision_id_hash.sql +V212__domaindsdatahistory_history_revision_id_hash.sql +V213__graceperiodhistory_history_revision_id_hash.sql diff --git a/db/src/main/resources/sql/flyway/V210__allocationtoken_token_hash.sql b/db/src/main/resources/sql/flyway/V210__allocationtoken_token_hash.sql new file mode 100644 index 000000000..0a47be4d6 --- /dev/null +++ b/db/src/main/resources/sql/flyway/V210__allocationtoken_token_hash.sql @@ -0,0 +1,16 @@ +-- Copyright 2025 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. + +-- Add hash indexes on columns that are commonly queried with a direct equals +CREATE INDEX CONCURRENTLY IF NOT EXISTS allocationtoken_token_hash ON "AllocationToken" USING hash (token); diff --git a/db/src/main/resources/sql/flyway/V211__domainhistoryhost_history_revision_id_hash.sql b/db/src/main/resources/sql/flyway/V211__domainhistoryhost_history_revision_id_hash.sql new file mode 100644 index 000000000..4def1449b --- /dev/null +++ b/db/src/main/resources/sql/flyway/V211__domainhistoryhost_history_revision_id_hash.sql @@ -0,0 +1,17 @@ +-- Copyright 2025 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. + +-- Add hash indexes on columns that are commonly queried with a direct equals +CREATE INDEX CONCURRENTLY IF NOT EXISTS domainhistoryhost_domain_history_history_revision_id_hash ON "DomainHistoryHost" + USING hash (domain_history_history_revision_id); diff --git a/db/src/main/resources/sql/flyway/V212__domaindsdatahistory_history_revision_id_hash.sql b/db/src/main/resources/sql/flyway/V212__domaindsdatahistory_history_revision_id_hash.sql new file mode 100644 index 000000000..5e6debcc6 --- /dev/null +++ b/db/src/main/resources/sql/flyway/V212__domaindsdatahistory_history_revision_id_hash.sql @@ -0,0 +1,17 @@ +-- Copyright 2025 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. + +-- Add hash indexes on columns that are commonly queried with a direct equals +CREATE INDEX CONCURRENTLY IF NOT EXISTS domaindsdatahistory_domain_history_revision_id_hash ON "DomainDsDataHistory" + USING hash (domain_history_revision_id); diff --git a/db/src/main/resources/sql/flyway/V213__graceperiodhistory_history_revision_id_hash.sql b/db/src/main/resources/sql/flyway/V213__graceperiodhistory_history_revision_id_hash.sql new file mode 100644 index 000000000..dc7efe2ac --- /dev/null +++ b/db/src/main/resources/sql/flyway/V213__graceperiodhistory_history_revision_id_hash.sql @@ -0,0 +1,17 @@ +-- Copyright 2025 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. + +-- Add hash indexes on columns that are commonly queried with a direct equals +CREATE INDEX CONCURRENTLY IF NOT EXISTS graceperiodhistory_domain_history_revision_id_hash ON "GracePeriodHistory" USING + hash (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 526734299..619421c56 100644 --- a/db/src/main/resources/sql/schema/nomulus.golden.sql +++ b/db/src/main/resources/sql/schema/nomulus.golden.sql @@ -1924,6 +1924,13 @@ ALTER TABLE ONLY public."User" CREATE INDEX allocation_token_domain_name_idx ON public."AllocationToken" USING btree (domain_name); +-- +-- Name: allocationtoken_token_hash; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX allocationtoken_token_hash ON public."AllocationToken" USING hash (token); + + -- -- Name: billingcancellation_billing_cancellation_id_hash; Type: INDEX; Schema: public; Owner: - -- @@ -1980,6 +1987,13 @@ CREATE INDEX domain_history_to_ds_data_history_idx ON public."DomainDsDataHistor CREATE INDEX domain_history_to_transaction_record_idx ON public."DomainTransactionRecord" USING btree (domain_repo_id, history_revision_id); +-- +-- Name: domaindsdatahistory_domain_history_revision_id_hash; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX domaindsdatahistory_domain_history_revision_id_hash ON public."DomainDsDataHistory" USING hash (domain_history_revision_id); + + -- -- Name: domainhistory_domain_repo_id_hash; Type: INDEX; Schema: public; Owner: - -- @@ -1994,6 +2008,13 @@ CREATE INDEX domainhistory_domain_repo_id_hash ON public."DomainHistory" USING h CREATE INDEX domainhistory_history_revision_id_hash ON public."DomainHistory" USING hash (history_revision_id); +-- +-- Name: domainhistoryhost_domain_history_history_revision_id_hash; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX domainhistoryhost_domain_history_history_revision_id_hash ON public."DomainHistoryHost" USING hash (domain_history_history_revision_id); + + -- -- Name: domainhost_domain_repo_id_hash; Type: INDEX; Schema: public; Owner: - -- @@ -2029,6 +2050,13 @@ CREATE INDEX graceperiod_domain_repo_id_hash ON public."GracePeriod" USING hash CREATE INDEX graceperiod_grace_period_id_hash ON public."GracePeriod" USING hash (grace_period_id); +-- +-- Name: graceperiodhistory_domain_history_revision_id_hash; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX graceperiodhistory_domain_history_revision_id_hash ON public."GracePeriodHistory" USING hash (domain_history_revision_id); + + -- -- Name: graceperiodhistory_grace_period_history_revision_id_hash; Type: INDEX; Schema: public; Owner: - --