Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

151 increase trade query performance #152

Merged
merged 10 commits into from
Mar 15, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog 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.8.xsd">

<changeSet id="add_latest_market_datum_demand_supply_price_indexes" author="daniel-j-mason">
<createIndex indexName="idx_latest_market_datum_buy_price" tableName="latest_market_datum">
<column name="buy_price" />
</createIndex>

<createIndex indexName="idx_latest_market_datum_sell_price" tableName="latest_market_datum">
<column name="sell_price" />
</createIndex>

<createIndex indexName="idx_latest_market_datum_demand" tableName="latest_market_datum">
<column name="demand" />
</createIndex>

<createIndex indexName="idx_latest_market_datum_stock" tableName="latest_market_datum">
<column name="stock" />
</createIndex>
</changeSet>

</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog 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.8.xsd">

<changeSet id="add_station_arrival_distance_index" author="daniel-j-mason">
<createIndex indexName="idx_station_arrival_distance" tableName="station">
<column name="arrival_distance" />
</createIndex>
</changeSet>

</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<include file="/db/trademodule/changelog/create_latest_market_datum_table.xml"/>
<include file="/db/trademodule/changelog/fill_latest_market_datum.xml"/>
<include file="/db/trademodule/changelog/add_unique_index_commodity_name.xml"/>
<include file="/db/trademodule/changelog/add_latest_market_datum_demand_supply_price_indexes.xml"/>
<include file="/db/trademodule/changelog/add_station_arrival_distance_index.xml"/>

<!-- views always last as they might depend on new columns -->
<include file="/db/trademodule/changelog/create_validated_commodity_view.xml"/>
Expand Down
Loading