Add domain repo ID and token type indexes to AllocationToken table (#1560)

These are useful for the purposes of filtering by one-time/multi-use tokens, and
for determining which one-time tokens have been used (and if so, for which
domain).
This commit is contained in:
Ben McIlwain 2022-03-17 13:58:45 -04:00 committed by GitHub
parent b248071eb3
commit 784d193e58
7 changed files with 1474 additions and 1388 deletions

View file

@ -76,6 +76,8 @@ import org.joda.time.DateTime;
@javax.persistence.Index( @javax.persistence.Index(
columnList = "domainName", columnList = "domainName",
name = "allocation_token_domain_name_idx"), name = "allocation_token_domain_name_idx"),
@javax.persistence.Index(columnList = "tokenType"),
@javax.persistence.Index(columnList = "redemption_domain_repo_id")
}) })
public class AllocationToken extends BackupGroupRoot implements Buildable, DatastoreAndSqlEntity { public class AllocationToken extends BackupGroupRoot implements Buildable, DatastoreAndSqlEntity {

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-15 20:34:14.292487</td> <td class="property_value">2022-03-16 18:17:27.007916</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">V113__add_host_missing_indexes.sql</td> <td id="lastFlywayFile" class="property_value">V114__add_allocation_token_indexes.sql</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -284,7 +284,7 @@ td.section {
generated on generated on
</text> </text>
<text text-anchor="start" x="4755.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-15 20:34:14.292487 2022-03-16 18:17:27.007916
</text> </text>
<polygon fill="none" stroke="#888888" points="4668.02,-4 4668.02,-44 4933.02,-44 4933.02,-4 4668.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">
@ -6698,6 +6698,18 @@ td.section {
<tr> <tr>
<td colspan="3"></td> <td colspan="3"></td>
</tr> </tr>
<tr>
<td colspan="2" class="name">idxtmlqd31dpvvd2g1h9i7erw6aj</td>
<td class="description right">[non-unique index]</td>
</tr>
<tr>
<td class="spacer"></td>
<td class="minwidth">redemption_domain_repo_id</td>
<td class="minwidth">ascending</td>
</tr>
<tr>
<td colspan="3"></td>
</tr>
<tr> <tr>
<td colspan="2" class="name">AllocationToken_pkey</td> <td colspan="2" class="name">AllocationToken_pkey</td>
<td class="description right">[unique index]</td> <td class="description right">[unique index]</td>
@ -6707,6 +6719,18 @@ td.section {
<td class="minwidth">token</td> <td class="minwidth">token</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">idx9g3s7mjv1yn4t06nqid39whss</td>
<td class="description right">[non-unique index]</td>
</tr>
<tr>
<td class="spacer"></td>
<td class="minwidth">token_type</td>
<td class="minwidth">ascending</td>
</tr>
</tbody> </tbody>
</table> </table>
<p>&nbsp;</p> <p>&nbsp;</p>

View file

@ -111,3 +111,4 @@ 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 V113__add_host_missing_indexes.sql
V114__add_allocation_token_indexes.sql

View file

@ -0,0 +1,17 @@
-- 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 IDX9g3s7mjv1yn4t06nqid39whss ON "AllocationToken" (token_type);
CREATE INDEX IDXtmlqd31dpvvd2g1h9i7erw6aj ON "AllocationToken" (redemption_domain_repo_id);

View file

@ -759,6 +759,8 @@
primary key (id) primary key (id)
); );
create index allocation_token_domain_name_idx on "AllocationToken" (domain_name); create index allocation_token_domain_name_idx on "AllocationToken" (domain_name);
create index IDX9g3s7mjv1yn4t06nqid39whss on "AllocationToken" (token_type);
create index IDXtmlqd31dpvvd2g1h9i7erw6aj on "AllocationToken" (redemption_domain_repo_id);
create index IDXih4b2tea127p5rb61gje6e1y2 on "BillingCancellation" (registrar_id); create index IDXih4b2tea127p5rb61gje6e1y2 on "BillingCancellation" (registrar_id);
create index IDX2exdfbx6oiiwnhr8j6gjpqt2j on "BillingCancellation" (event_time); create index IDX2exdfbx6oiiwnhr8j6gjpqt2j on "BillingCancellation" (event_time);
create index IDXl8vobbecsd32k4ksavdfx8st6 on "BillingCancellation" (domain_repo_id); create index IDXl8vobbecsd32k4ksavdfx8st6 on "BillingCancellation" (domain_repo_id);

View file

@ -1623,6 +1623,13 @@ CREATE INDEX idx73l103vc5900ig3p4odf0cngt ON public."BillingEvent" USING btree (
CREATE INDEX idx8nr0ke9mrrx4ewj6pd2ag4rmr ON public."Domain" USING btree (creation_time); CREATE INDEX idx8nr0ke9mrrx4ewj6pd2ag4rmr ON public."Domain" USING btree (creation_time);
--
-- Name: idx9g3s7mjv1yn4t06nqid39whss; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX idx9g3s7mjv1yn4t06nqid39whss ON public."AllocationToken" USING btree (token_type);
-- --
-- Name: idx9q53px6r302ftgisqifmc6put; Type: INDEX; Schema: public; Owner: - -- Name: idx9q53px6r302ftgisqifmc6put; Type: INDEX; Schema: public; Owner: -
-- --
@ -1945,6 +1952,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: idxtmlqd31dpvvd2g1h9i7erw6aj; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX idxtmlqd31dpvvd2g1h9i7erw6aj ON public."AllocationToken" USING btree (redemption_domain_repo_id);
-- --
-- Name: idxy98mebut8ix1v07fjxxdkqcx; Type: INDEX; Schema: public; Owner: - -- Name: idxy98mebut8ix1v07fjxxdkqcx; Type: INDEX; Schema: public; Owner: -
-- --