Skip to content

Commit

Permalink
Merge branch 'master' into tsachi/update_go_dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
tsachiherman authored Oct 18, 2023
2 parents 736c2b9 + 1f0dede commit 66969a9
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
2 changes: 2 additions & 0 deletions services/horizon/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ file. This project adheres to [Semantic Versioning](http://semver.org/).
- Limit the display of global flags on command line help `-h` output ([5077](https://github.com/stellar/go/pull/5077)).
- Add a deprecation warning for using command-line flags when running Horizon ([5051](https://github.com/stellar/go/pull/5051))

### DB Schema Migration
- Drop unused indices from the Horizon database. For the database with full history, the migration is anticipated to take up to an hour and is expected to free up approximately 1.3TB of storage ([5081](https://github.com/stellar/go/pull/5081)).

## 2.26.1

Expand Down
23 changes: 23 additions & 0 deletions services/horizon/internal/db2/schema/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-- +migrate Up notransaction

DROP INDEX IF EXISTS accounts_home_domain;
DROP INDEX IF EXISTS accounts_inflation_destination;
DROP INDEX IF EXISTS asset_by_issuer;
DROP INDEX IF EXISTS claimabable_balances_by_claimants;
DROP INDEX IF EXISTS htrd_time_lookup;
DROP INDEX IF EXISTS index_history_effects_on_type;
DROP INDEX IF EXISTS index_history_ledgers_on_closed_at;
DROP INDEX IF EXISTS index_history_ledgers_on_importer_version;
DROP INDEX IF EXISTS index_history_ledgers_on_ledger_hash;
DROP INDEX IF EXISTS index_history_ledgers_on_previous_ledger_hash;
DROP INDEX IF EXISTS index_history_operation_claimable_balances_on_ids;
DROP INDEX IF EXISTS index_history_operations_on_type;
DROP INDEX IF EXISTS index_history_transaction_claimable_balances_on_ids;
DROP INDEX IF EXISTS trade_effects_by_order_book;
DROP INDEX IF EXISTS trust_lines_by_issuer;

-- +migrate Down notransaction
CREATE INDEX IF NOT EXISTS accounts_home_domain ON accounts USING BTREE(home_domain);
CREATE INDEX IF NOT EXISTS accounts_inflation_destination ON accounts USING BTREE(inflation_destination);
CREATE INDEX IF NOT EXISTS asset_by_issuer ON history_assets USING btree (asset_issuer);
CREATE INDEX IF NOT EXISTS claimabable_balances_by_claimants ON claimable_balances USING gin(claimants jsonb_path_ops);
CREATE INDEX IF NOT EXISTS htrd_time_lookup ON history_trades USING BTREE(ledger_closed_at);
CREATE INDEX IF NOT EXISTS index_history_effects_on_type ON history_effects USING btree (type);
CREATE INDEX IF NOT EXISTS index_history_ledgers_on_closed_at ON history_ledgers USING btree (closed_at);
CREATE INDEX IF NOT EXISTS index_history_ledgers_on_importer_version ON history_ledgers USING btree (importer_version);
CREATE UNIQUE INDEX IF NOT EXISTS index_history_ledgers_on_ledger_hash ON history_ledgers USING btree (ledger_hash);
CREATE UNIQUE INDEX IF NOT EXISTS index_history_ledgers_on_previous_ledger_hash ON history_ledgers USING btree (previous_ledger_hash);
CREATE UNIQUE INDEX IF NOT EXISTS index_history_operation_claimable_balances_on_ids ON history_operation_claimable_balances USING btree (history_operation_id , history_claimable_balance_id);
CREATE INDEX IF NOT EXISTS index_history_operations_on_type ON history_operations USING btree (type);
CREATE UNIQUE INDEX IF NOT EXISTS index_history_transaction_claimable_balances_on_ids ON history_transaction_claimable_balances USING btree (history_transaction_id , history_claimable_balance_id);
CREATE INDEX IF NOT EXISTS trade_effects_by_order_book ON history_effects USING btree (((details ->> 'sold_asset_type'::text)), ((details ->> 'sold_asset_code'::text)), ((details ->> 'sold_asset_issuer'::text)), ((details ->> 'bought_asset_type'::text)), ((details ->> 'bought_asset_code'::text)), ((details ->> 'bought_asset_issuer'::text))) WHERE (type = 33);
CREATE INDEX IF NOT EXISTS trust_lines_by_issuer ON trust_lines USING BTREE(asset_issuer);

0 comments on commit 66969a9

Please sign in to comment.