Skip to content

Commit

Permalink
CORE-17471 - Apply indexing to frequently used columns of the db tabl…
Browse files Browse the repository at this point in the history
…e `utxo_transaction_output` (#1275)

The token selection feature uses db queries frequently. Indexing the columns that are used by those queries will improve performance. This commit indexes the columns `token_type`, `token_issuer_hash`, `token_symbol`, and `token_notary_x500_name` from table `utxo_transaction_output`.
  • Loading branch information
filipesoliveira authored Oct 5, 2023
1 parent 4f8bdaf commit 523413e
Showing 1 changed file with 26 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,35 @@
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd">

<changeSet author="R3.Corda" id="ledger-utxo-creation-v5.1">
<createIndex
indexName="utxo_visible_transaction_state_idx_consumed"
tableName="utxo_visible_transaction_state">
<column name="consumed"/>
</createIndex>
<createIndex indexName="utxo_visible_transaction_state_idx_consumed"
tableName="utxo_visible_transaction_state">
<column name="consumed"/>
</createIndex>

<createIndex
indexName="utxo_transaction_output_idx_type"
tableName="utxo_transaction_output">
<createIndex indexName="utxo_transaction_output_idx_type"
tableName="utxo_transaction_output">
<column name="type"/>
</createIndex>

<createIndex indexName="utxo_transaction_output_idx_token_type"
tableName="utxo_transaction_output">
<column name="token_type"/>
</createIndex>

<createIndex indexName="utxo_transaction_output_idx_token_issuer_hash"
tableName="utxo_transaction_output">
<column name="token_issuer_hash"/>
</createIndex>

<createIndex indexName="utxo_transaction_output_idx_token_symbol"
tableName="utxo_transaction_output">
<column name="token_symbol"/>
</createIndex>

<createIndex indexName="utxo_transaction_output_idx_token_notary_x500_name"
tableName="utxo_transaction_output">
<column name="token_notary_x500_name"/>
</createIndex>
</changeSet>

</databaseChangeLog>

0 comments on commit 523413e

Please sign in to comment.