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 2f49fb584..fe218f7d3 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 @@ -257,15 +257,15 @@ td.section { generated by - SchemaCrawler 17.11.1 + SchemaCrawler 17.12.2 generated on - 2026-07-14 19:18:20 + 2026-08-05 12:44:04 last flyway file - V225__user_registry_lock_email_address_index.sql + V226__tld_domain_name_index.sql @@ -273,7 +273,7 @@ td.section {

 

- SchemaCrawler_Diagram generated by SchemaCrawler 17.11.1 generated on 2026-07-14 19:18:20 + SchemaCrawler_Diagram generated by SchemaCrawler 17.12.2 generated on 2026-08-05 12:44:04 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 a0457de1b..67d9fcd1b 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 @@ -257,15 +257,15 @@ td.section {
generated by - SchemaCrawler 17.11.1 + SchemaCrawler 17.12.2
generated on - 2026-07-14 19:18:19 + 2026-08-05 12:44:03
last flyway file - V225__user_registry_lock_email_address_index.sql + V226__tld_domain_name_index.sql
@@ -273,7 +273,7 @@ td.section {

 

- SchemaCrawler_Diagram generated by SchemaCrawler 17.11.1 generated on 2026-07-14 19:18:19 + SchemaCrawler_Diagram generated by SchemaCrawler 17.12.2 generated on 2026-08-05 12:44:03 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 @@ -3683,6 +3683,23 @@ td.section { deletion_time ascending +
+ +
+
+ domain_tld_domain_name_idx + [non-unique index] +
+
+ + tld + ascending +
+
+ + domain_name + ascending +

 

diff --git a/db/src/main/resources/sql/flyway.txt b/db/src/main/resources/sql/flyway.txt index c31dc8a43..f2dadff5b 100644 --- a/db/src/main/resources/sql/flyway.txt +++ b/db/src/main/resources/sql/flyway.txt @@ -223,3 +223,4 @@ V222__remove_contact.sql V223__tld_change_xap_enabled_to_transitions.sql V224__add_registrar_expiry_access_period_enabled.sql V225__user_registry_lock_email_address_index.sql +V226__tld_domain_name_index.sql diff --git a/db/src/main/resources/sql/flyway/V226__tld_domain_name_index.sql b/db/src/main/resources/sql/flyway/V226__tld_domain_name_index.sql new file mode 100644 index 000000000..26000eb1c --- /dev/null +++ b/db/src/main/resources/sql/flyway/V226__tld_domain_name_index.sql @@ -0,0 +1,17 @@ +-- Copyright 2026 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. + +-- RDAP queries by TLD need to order results. Using a btree that combines +-- TLD and name allows us to do this quickly +CREATE INDEX CONCURRENTLY IF NOT EXISTS domain_tld_domain_name_idx ON "Domain" (tld, domain_name); diff --git a/db/src/main/resources/sql/schema/nomulus.golden.sql b/db/src/main/resources/sql/schema/nomulus.golden.sql index 09d6e86f5..d041fef59 100644 --- a/db/src/main/resources/sql/schema/nomulus.golden.sql +++ b/db/src/main/resources/sql/schema/nomulus.golden.sql @@ -1841,6 +1841,13 @@ CREATE INDEX domain_history_to_transaction_record_idx ON public."DomainTransacti CREATE UNIQUE INDEX domain_no_duplicate_active ON public."Domain" USING btree (domain_name) WHERE (deletion_time = '294247-01-10 04:00:54.775+00'::timestamp with time zone); +-- +-- Name: domain_tld_domain_name_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX domain_tld_domain_name_idx ON public."Domain" USING btree (tld, domain_name); + + -- -- Name: domaindsdatahistory_domain_history_revision_id_hash; Type: INDEX; Schema: public; Owner: - --