Skip to content

Commit

Permalink
horizon: Improve performance of migrations/64_add_payment_flag_histor…
Browse files Browse the repository at this point in the history
…y_ops.sql (#5056)

Remove index_history_operations_on_is_payment because it is not actually used in the payments query.
  • Loading branch information
tamirms authored Sep 22, 2023
1 parent 4391e0b commit 5bfe563
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
29 changes: 26 additions & 3 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
@@ -1,9 +1,7 @@
-- +migrate Up

ALTER TABLE history_operations ADD is_payment boolean;
CREATE INDEX "index_history_operations_on_is_payment" ON history_operations USING btree (is_payment);

-- +migrate Down

DROP INDEX "index_history_operations_on_is_payment";
ALTER TABLE history_operations DROP COLUMN is_payment;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- +migrate Up

-- index_history_operations_on_is_payment was added in migration 64 but it turns out
-- the index was not necessary, see https://github.com/stellar/go/issues/5059
DROP INDEX IF EXISTS "index_history_operations_on_is_payment";

-- +migrate Down

0 comments on commit 5bfe563

Please sign in to comment.