Skip to content

Commit

Permalink
Add second index (XML)
Browse files Browse the repository at this point in the history
  • Loading branch information
aednichols committed Oct 16, 2024
1 parent eafe5cf commit 675384a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog objectQuotingStrategy="QUOTE_ALL_OBJECTS"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd">

<changeSet id="index_add_workflow_call_scatter_attempt_key" author="anichols" dbms="hsqldb,mariadb,mysql,postgresql">
<!--
This index creates at about 3M rows per minute on MySQL.
That would be an impossible multi-day downtime in Terra, so we manually pre-create the index asynchronously.
This changeset detects environments where this has been done and immediately marks itself as applied.
-->
<preConditions onFail="MARK_RAN">
<not>
<indexExists indexName="IX_METADATA_ENTRY_WEU_CF_JSI_JRA_MK"/>
</not>
</preConditions>
<createIndex indexName="IX_METADATA_ENTRY_WEU_CF_JSI_JRA_MK" tableName="METADATA_ENTRY">
<column name="WORKFLOW_EXECUTION_UUID"/>
<column name="CALL_FQN"/>
<column name="JOB_SCATTER_INDEX"/>
<column name="JOB_RETRY_ATTEMPT"/>
<column name="METADATA_KEY"/>
</createIndex>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd">

<changeSet id="metadata_index_add_workflow_key" author="anichols" dbms="hsqldb,mariadb,mysql,postgresql">
<changeSet id="index_add_workflow_key" author="anichols" dbms="hsqldb,mariadb,mysql,postgresql">
<!--
This index creates at about 3M rows per minute on MySQL.
That would be an impossible multi-day downtime in Terra, so we manually pre-create the index asynchronously.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
<include file="metadata_changesets/remove_non_summarizable_metadata_from_queue.xml" relativeToChangelogFile="true" />
<include file="metadata_changesets/update_metadata_archive_index.xml" relativeToChangelogFile="true" />
<include file="metadata_changesets/reset_archive_statuses_to_null.xml" relativeToChangelogFile="true" />
<include file="metadata_changesets/metadata_index_add_workflow_key.xml" relativeToChangelogFile="true" />
<include file="metadata_changesets/index_add_workflow_key.xml" relativeToChangelogFile="true" />
<include file="metadata_changesets/index_add_workflow_call_scatter_attempt_key.xml" relativeToChangelogFile="true" />
<!-- WARNING!
This changeset should always be last.
It it always run (and should always run last) to set table ownership correctly.
Expand Down

0 comments on commit 675384a

Please sign in to comment.