-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
horizon: Improve performance of migrations/64_add_payment_flag_histor…
…y_ops.sql (#5056) Remove index_history_operations_on_is_payment because it is not actually used in the payments query.
- Loading branch information
Showing
3 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
services/horizon/internal/db2/schema/migrations/64_add_payment_flag_history_ops.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
7 changes: 7 additions & 0 deletions
7
services/horizon/internal/db2/schema/migrations/65_drop_payment_index.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |