remove partial_path and contract_hash columns and indexes
This commit is contained in:
parent
3fd1638ff6
commit
b06b4f2cfb
@ -5,7 +5,6 @@ CREATE TABLE IF NOT EXISTS eth.receipt_cids (
|
||||
tx_id VARCHAR(66) NOT NULL,
|
||||
cid TEXT NOT NULL,
|
||||
contract VARCHAR(66),
|
||||
contract_hash VARCHAR(66),
|
||||
post_state VARCHAR(66),
|
||||
post_status SMALLINT,
|
||||
PRIMARY KEY (tx_id, header_id, block_number)
|
||||
|
@ -4,7 +4,6 @@ CREATE TABLE IF NOT EXISTS eth.state_cids (
|
||||
header_id VARCHAR(66) NOT NULL,
|
||||
state_leaf_key VARCHAR(66) NOT NULL,
|
||||
cid TEXT NOT NULL,
|
||||
partial_path BYTEA NOT NULL,
|
||||
diff BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
balance NUMERIC, -- NULL if "removed"
|
||||
nonce BIGINT, -- NULL if "removed"
|
||||
|
@ -5,7 +5,6 @@ CREATE TABLE IF NOT EXISTS eth.storage_cids (
|
||||
state_leaf_key VARCHAR(66) NOT NULL,
|
||||
storage_leaf_key VARCHAR(66) NOT NULL,
|
||||
cid TEXT NOT NULL,
|
||||
partial_path BYTEA NOT NULL,
|
||||
diff BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
val BYTEA, -- NULL if "removed"
|
||||
removed BOOLEAN NOT NULL,
|
||||
|
@ -22,13 +22,11 @@ CREATE INDEX rct_block_number_index ON eth.receipt_cids USING brin (block_number
|
||||
CREATE INDEX rct_header_id_index ON eth.receipt_cids USING btree (header_id);
|
||||
CREATE INDEX rct_cid_block_number_index ON eth.receipt_cids USING btree (cid, block_number);
|
||||
CREATE INDEX rct_contract_index ON eth.receipt_cids USING btree (contract);
|
||||
CREATE INDEX rct_contract_hash_index ON eth.receipt_cids USING btree (contract_hash);
|
||||
|
||||
-- state node indexes
|
||||
CREATE INDEX state_block_number_index ON eth.state_cids USING brin (block_number);
|
||||
CREATE INDEX state_cid_block_number_index ON eth.state_cids USING btree (cid, block_number);
|
||||
CREATE INDEX state_header_id_index ON eth.state_cids USING btree (header_id);
|
||||
CREATE INDEX state_partial_path_index ON eth.state_cids USING btree (partial_path);
|
||||
CREATE INDEX state_removed_index ON eth.state_cids USING btree (removed);
|
||||
CREATE INDEX state_code_hash_index ON eth.state_cids USING btree (code_hash); -- could be useful for e.g. selecting all the state accounts with the same contract bytecode deployed
|
||||
CREATE INDEX state_leaf_key_block_number_index ON eth.state_cids(state_leaf_key, block_number DESC);
|
||||
@ -38,7 +36,6 @@ CREATE INDEX storage_block_number_index ON eth.storage_cids USING brin (block_nu
|
||||
CREATE INDEX storage_state_leaf_key_index ON eth.storage_cids USING btree (state_leaf_key);
|
||||
CREATE INDEX storage_cid_block_number_index ON eth.storage_cids USING btree (cid, block_number);
|
||||
CREATE INDEX storage_header_id_index ON eth.storage_cids USING btree (header_id);
|
||||
CREATE INDEX storage_partial_path_index ON eth.storage_cids USING btree (partial_path);
|
||||
CREATE INDEX storage_removed_index ON eth.storage_cids USING btree (removed);
|
||||
CREATE INDEX storage_leaf_key_block_number_index ON eth.storage_cids(storage_leaf_key, block_number DESC);
|
||||
|
||||
@ -75,7 +72,6 @@ DROP INDEX eth.access_list_block_number_index;
|
||||
|
||||
-- storage node indexes
|
||||
DROP INDEX eth.storage_removed_index;
|
||||
DROP INDEX eth.storage_partial_path_index;
|
||||
DROP INDEX eth.storage_header_id_index;
|
||||
DROP INDEX eth.storage_cid_block_number_index;
|
||||
DROP INDEX eth.storage_leaf_key_index;
|
||||
@ -86,14 +82,12 @@ DROP INDEX eth.storage_leaf_key_block_number_index;
|
||||
-- state node indexes
|
||||
DROP INDEX eth.state_code_hash_index;
|
||||
DROP INDEX eth.state_removed_index;
|
||||
DROP INDEX eth.state_partial_path_index;
|
||||
DROP INDEX eth.state_header_id_index;
|
||||
DROP INDEX eth.state_cid_block_number_index;
|
||||
DROP INDEX eth.state_block_number_index;
|
||||
DROP INDEX eth.state_leaf_key_block_number_index;
|
||||
|
||||
-- receipt indexes
|
||||
DROP INDEX eth.rct_contract_hash_index;
|
||||
DROP INDEX eth.rct_contract_index;
|
||||
DROP INDEX eth.rct_cid_block_number_index;
|
||||
DROP INDEX eth.rct_header_id_index;
|
Loading…
Reference in New Issue
Block a user