-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migration/schema handling improvements around migration 21 (#6288)
## Motivation Migration 21 has performance issues even with VACUUM INTO being used for migration. Schema drift detection code prints bad diffs
- Loading branch information
Showing
5 changed files
with
52 additions
and
37 deletions.
There are no files selected for viewing
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
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
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
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,14 +1,13 @@ | ||
-- Table showing the PoST commitment by a smesher in given ATX. | ||
-- It shows the exact number of space units committed and the previous ATX id. | ||
CREATE TABLE posts ( | ||
atxid CHAR(32) NOT NULL, | ||
pubkey CHAR(32) NOT NULL, | ||
prev_atxid CHAR(32), | ||
prev_atx_index INT, | ||
units INT NOT NULL, | ||
UNIQUE (atxid, pubkey) | ||
); | ||
|
||
CREATE INDEX posts_by_atxid_by_pubkey ON posts (atxid, pubkey, prev_atxid); | ||
atxid CHAR(32) NOT NULL, | ||
pubkey CHAR(32) NOT NULL, | ||
prev_atxid CHAR(32), | ||
prev_atx_index INT, | ||
units INT NOT NULL | ||
); | ||
CREATE UNIQUE INDEX posts_by_atxid_by_pubkey ON posts (atxid, pubkey); | ||
CREATE INDEX posts_by_atxid_by_pubkey_prev_atxid ON posts (atxid, pubkey, prev_atxid); | ||
|
||
ALTER TABLE atxs DROP COLUMN prev_id; |
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