-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from vulcanize/release-v3.0.1
disable and renable indexes correctly
- Loading branch information
Showing
12 changed files
with
103 additions
and
33 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
20 changes: 10 additions & 10 deletions
20
db/post_batch_processing_migrations/00018_create_log_indexes.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,15 +1,15 @@ | ||
-- +goose Up | ||
CREATE INDEX log_mh_index_index ON eth.log_cids USING btree (leaf_mh_key); | ||
CREATE INDEX log_mh_index ON eth.log_cids USING btree (leaf_mh_key); | ||
CREATE INDEX block_number_index ON eth.header_cids USING brin (block_number); | ||
CREATE INDEX header_hash_index ON eth.header_cids USING btree (block_hash); | ||
CREATE INDEX tx_header_hash_index ON eth.transaction_cids USING btree (header_id); | ||
CREATE INDEX transaction_hash_index ON eth.transaction_cids USING btree (tx_hash); | ||
CREATE INDEX log_tx_hash_index ON eth.log_cids USING btree (rct_id); | ||
CREATE INDEX header_block_hash_index ON eth.header_cids USING btree (block_hash); | ||
CREATE INDEX tx_header_id_index ON eth.transaction_cids USING btree (header_id); | ||
CREATE INDEX tx_tx_hash_index ON eth.transaction_cids USING btree (tx_hash); | ||
CREATE INDEX log_cids_index ON eth.log_cids USING btree (rct_id, index); | ||
|
||
-- +goose Down | ||
DROP INDEX eth.log_tx_hash_index; | ||
DROP INDEX eth.transaction_hash_index; | ||
DROP INDEX eth.tx_header_hash_index; | ||
DROP INDEX eth.header_hash_index; | ||
DROP INDEX eth.log_cids_index; | ||
DROP INDEX eth.tx_tx_hash_index; | ||
DROP INDEX eth.tx_header_id_index; | ||
DROP INDEX eth.header_block_hash_index; | ||
DROP INDEX eth.block_number_index; | ||
DROP INDEX eth.log_mh_index_index; | ||
DROP INDEX eth.log_mh_index; |
45 changes: 45 additions & 0 deletions
45
db/post_batch_processing_migrations/00019_disable_log_indexes.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,45 @@ | ||
-- +goose Up | ||
UPDATE pg_index | ||
SET indisready=false | ||
WHERE indrelid = ( | ||
SELECT oid | ||
FROM pg_class | ||
WHERE relname='eth.log_cids' | ||
); | ||
UPDATE pg_index | ||
SET indisready=false | ||
WHERE indrelid = ( | ||
SELECT oid | ||
FROM pg_class | ||
WHERE relname='eth.transaction_cids' | ||
); | ||
UPDATE pg_index | ||
SET indisready=false | ||
WHERE indrelid = ( | ||
SELECT oid | ||
FROM pg_class | ||
WHERE relname='eth.header_cids' | ||
); | ||
|
||
-- +goose Down | ||
UPDATE pg_index | ||
SET indisready=true | ||
WHERE indrelid = ( | ||
SELECT oid | ||
FROM pg_class | ||
WHERE relname='eth.header_cids' | ||
); | ||
UPDATE pg_index | ||
SET indisready=true | ||
WHERE indrelid = ( | ||
SELECT oid | ||
FROM pg_class | ||
WHERE relname='eth.transaction_cids' | ||
); | ||
UPDATE pg_index | ||
SET indisready=true | ||
WHERE indrelid = ( | ||
SELECT oid | ||
FROM pg_class | ||
WHERE relname='eth.log_cids' | ||
); |
15 changes: 0 additions & 15 deletions
15
db/post_batch_processing_migrations/00019_remove_log_indexes.sql
This file was deleted.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
db/post_batch_processing_migrations/00020_reenable_and_rebuild_log_indexes.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,48 @@ | ||
-- +goose Up | ||
UPDATE pg_index | ||
SET indisready=true | ||
WHERE indrelid = ( | ||
SELECT oid | ||
FROM pg_class | ||
WHERE relname='eth.header_cids' | ||
); | ||
UPDATE pg_index | ||
SET indisready=true | ||
WHERE indrelid = ( | ||
SELECT oid | ||
FROM pg_class | ||
WHERE relname='eth.transaction_cids' | ||
); | ||
UPDATE pg_index | ||
SET indisready=true | ||
WHERE indrelid = ( | ||
SELECT oid | ||
FROM pg_class | ||
WHERE relname='eth.log_cids' | ||
); | ||
REINDEX TABLE eth.header_cids; | ||
REINDEX TABLE eth.transaction_cids; | ||
REINDEX TABLE eth.log_cids; | ||
|
||
-- +goose Down | ||
UPDATE pg_index | ||
SET indisready=false | ||
WHERE indrelid = ( | ||
SELECT oid | ||
FROM pg_class | ||
WHERE relname='eth.log_cids' | ||
); | ||
UPDATE pg_index | ||
SET indisready=false | ||
WHERE indrelid = ( | ||
SELECT oid | ||
FROM pg_class | ||
WHERE relname='eth.transaction_cids' | ||
); | ||
UPDATE pg_index | ||
SET indisready=false | ||
WHERE indrelid = ( | ||
SELECT oid | ||
FROM pg_class | ||
WHERE relname='eth.header_cids' | ||
); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.