Add 3 more SQL indexes to the Host table (#1559)

* Add 3 more SQL indexes to the Host table

These indexes on creationTime, deletionTime, and currentSponsorRegistrarId are
present on the other two EPP resource tables (Domain and Contact), and are
useful for a wide variety of operations/analytics queries.
This commit is contained in:
Ben McIlwain 2022-03-15 22:16:36 -04:00 committed by GitHub
parent df7c60aec5
commit a3ca052115
7 changed files with 815 additions and 705 deletions

View file

@ -47,7 +47,12 @@ import javax.persistence.AccessType;
* would prevent us from using JPA standard bootstrapping). For now, there is no obvious benefit * would prevent us from using JPA standard bootstrapping). For now, there is no obvious benefit
* doing either. * 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") @ExternalMessagingName("host")
@WithStringVKey @WithStringVKey
@Access(AccessType.FIELD) // otherwise it'll use the default if the repoId (property) @Access(AccessType.FIELD) // otherwise it'll use the default if the repoId (property)

File diff suppressed because it is too large Load diff

View file

@ -261,11 +261,11 @@ td.section {
</tr> </tr>
<tr> <tr>
<td class="property_name">generated on</td> <td class="property_name">generated on</td>
<td class="property_value">2022-03-14 17:59:44.31197</td> <td class="property_value">2022-03-15 20:34:14.292487</td>
</tr> </tr>
<tr> <tr>
<td class="property_name">last flyway file</td> <td class="property_name">last flyway file</td>
<td id="lastFlywayFile" class="property_value">V112__add_billingrecurrence_missing_indexes.sql</td> <td id="lastFlywayFile" class="property_value">V113__add_host_missing_indexes.sql</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -274,19 +274,19 @@ td.section {
<svg viewbox="0.00 0.00 4949.02 4890.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="erDiagram" style="overflow: hidden; width: 100%; height: 800px"> <g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 4886.5)"> <svg viewbox="0.00 0.00 4949.02 4890.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="erDiagram" style="overflow: hidden; width: 100%; height: 800px"> <g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 4886.5)">
<title>SchemaCrawler_Diagram</title> <title>SchemaCrawler_Diagram</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-4886.5 4945.02,-4886.5 4945.02,4 -4,4" /> <polygon fill="white" stroke="transparent" points="-4,4 -4,-4886.5 4945.02,-4886.5 4945.02,4 -4,4" />
<text text-anchor="start" x="4680.52" y="-29.8" font-family="Helvetica,sans-Serif" font-size="14.00"> <text text-anchor="start" x="4672.52" y="-29.8" font-family="Helvetica,sans-Serif" font-size="14.00">
generated by generated by
</text> </text>
<text text-anchor="start" x="4763.52" y="-29.8" font-family="Helvetica,sans-Serif" font-size="14.00"> <text text-anchor="start" x="4755.52" y="-29.8" font-family="Helvetica,sans-Serif" font-size="14.00">
SchemaCrawler 16.10.1 SchemaCrawler 16.10.1
</text> </text>
<text text-anchor="start" x="4679.52" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00"> <text text-anchor="start" x="4671.52" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
generated on generated on
</text> </text>
<text text-anchor="start" x="4763.52" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00"> <text text-anchor="start" x="4755.52" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
2022-03-14 17:59:44.31197 2022-03-15 20:34:14.292487
</text> </text>
<polygon fill="none" stroke="#888888" points="4676.02,-4 4676.02,-44 4933.02,-44 4933.02,-4 4676.02,-4" /> <!-- allocationtoken_a08ccbef --> <polygon fill="none" stroke="#888888" points="4668.02,-4 4668.02,-44 4933.02,-44 4933.02,-4 4668.02,-4" /> <!-- allocationtoken_a08ccbef -->
<g id="node1" class="node"> <g id="node1" class="node">
<title>allocationtoken_a08ccbef</title> <title>allocationtoken_a08ccbef</title>
<polygon fill="#ebcef2" stroke="transparent" points="3100.5,-651.5 3100.5,-670.5 3299.5,-670.5 3299.5,-651.5 3100.5,-651.5" /> <polygon fill="#ebcef2" stroke="transparent" points="3100.5,-651.5 3100.5,-670.5 3299.5,-670.5 3299.5,-651.5 3100.5,-651.5" />
@ -11323,6 +11323,18 @@ td.section {
<tr> <tr>
<td colspan="3"></td> <td colspan="3"></td>
</tr> </tr>
<tr>
<td colspan="2" class="name">idxl49vydnq0h5j1piefwjy4i8er</td>
<td class="description right">[non-unique index]</td>
</tr>
<tr>
<td class="spacer"></td>
<td class="minwidth">current_sponsor_registrar_id</td>
<td class="minwidth">ascending</td>
</tr>
<tr>
<td colspan="3"></td>
</tr>
<tr> <tr>
<td colspan="2" class="name">idxkpkh68n6dy5v51047yr6b0e9l</td> <td colspan="2" class="name">idxkpkh68n6dy5v51047yr6b0e9l</td>
<td class="description right">[non-unique index]</td> <td class="description right">[non-unique index]</td>
@ -11344,6 +11356,30 @@ td.section {
<td class="minwidth">repo_id</td> <td class="minwidth">repo_id</td>
<td class="minwidth">ascending</td> <td class="minwidth">ascending</td>
</tr> </tr>
<tr>
<td colspan="3"></td>
</tr>
<tr>
<td colspan="2" class="name">idxy98mebut8ix1v07fjxxdkqcx</td>
<td class="description right">[non-unique index]</td>
</tr>
<tr>
<td class="spacer"></td>
<td class="minwidth">creation_time</td>
<td class="minwidth">ascending</td>
</tr>
<tr>
<td colspan="3"></td>
</tr>
<tr>
<td colspan="2" class="name">idxovmntef6l45tw2bsfl56tcugx</td>
<td class="description right">[non-unique index]</td>
</tr>
<tr>
<td class="spacer"></td>
<td class="minwidth">deletion_time</td>
<td class="minwidth">ascending</td>
</tr>
</tbody> </tbody>
</table> </table>
<p>&nbsp;</p> <p>&nbsp;</p>

View file

@ -110,3 +110,4 @@ V109__add_domain_host_missing_indexes_from_query_analyzer.sql
V110__add_graceperiod_missing_indexes_from_query_analyzer.sql V110__add_graceperiod_missing_indexes_from_query_analyzer.sql
V111__add_billingcancellation_missing_indexes.sql V111__add_billingcancellation_missing_indexes.sql
V112__add_billingrecurrence_missing_indexes.sql V112__add_billingrecurrence_missing_indexes.sql
V113__add_host_missing_indexes.sql

View file

@ -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);

View file

@ -817,6 +817,9 @@ create index IDXbgssjudpm428mrv0xfpvgifps on "GracePeriod" (billing_event_id);
create index IDX5u5m6clpk3nktrvtyy5umacb6 on "GracePeriod" (billing_recurrence_id); create index IDX5u5m6clpk3nktrvtyy5umacb6 on "GracePeriod" (billing_recurrence_id);
create index IDXd01j17vrpjxaerxdmn8bwxs7s on "GracePeriodHistory" (domain_repo_id); create index IDXd01j17vrpjxaerxdmn8bwxs7s on "GracePeriodHistory" (domain_repo_id);
create index IDXkpkh68n6dy5v51047yr6b0e9l on "Host" (host_name); 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 IDXfg2nnjlujxo6cb9fha971bq2n on "HostHistory" (creation_time);
create index IDX1iy7njgb7wjmj9piml4l2g0qi on "HostHistory" (history_registrar_id); create index IDX1iy7njgb7wjmj9piml4l2g0qi on "HostHistory" (history_registrar_id);
create index IDXkkwbwcwvrdkkqothkiye4jiff on "HostHistory" (host_name); create index IDXkkwbwcwvrdkkqothkiye4jiff on "HostHistory" (host_name);

View file

@ -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); 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: - -- 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); 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: - -- 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); 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: - -- Name: premiumlist_name_idx; Type: INDEX; Schema: public; Owner: -
-- --