diff --git a/db/migrations/00014_create_cid_indexes.sql b/db/migrations/00014_create_cid_indexes.sql index 662d040..a360017 100644 --- a/db/migrations/00014_create_cid_indexes.sql +++ b/db/migrations/00014_create_cid_indexes.sql @@ -3,7 +3,7 @@ CREATE INDEX header_block_number_index ON eth.header_cids USING brin (block_number); CREATE UNIQUE INDEX header_cid_index ON eth.header_cids USING btree (cid, block_number); CREATE UNIQUE INDEX header_mh_block_number_index ON eth.header_cids USING btree (mh_key, block_number); -CREATE INDEX state_root_index ON eth.header_cids USING btree (state_root); +CREATE INDEX state_root_index ON eth.header_cids USING hash (state_root); CREATE INDEX timestamp_index ON eth.header_cids USING brin (timestamp); -- uncle indexes @@ -13,19 +13,19 @@ CREATE INDEX uncle_header_id_index ON eth.uncle_cids USING btree (header_id); -- transaction indexes CREATE INDEX tx_block_number_index ON eth.transaction_cids USING brin (block_number); -CREATE INDEX tx_header_id_index ON eth.transaction_cids USING btree (header_id); +CREATE INDEX tx_header_id_index ON eth.transaction_cids USING hash (header_id); CREATE INDEX tx_cid_index ON eth.transaction_cids USING btree (cid, block_number); CREATE INDEX tx_mh_block_number_index ON eth.transaction_cids USING btree (mh_key, block_number); -CREATE INDEX tx_dst_index ON eth.transaction_cids USING btree (dst); -CREATE INDEX tx_src_index ON eth.transaction_cids USING btree (src); +CREATE INDEX tx_dst_index ON eth.transaction_cids USING hash (dst); +CREATE INDEX tx_src_index ON eth.transaction_cids USING hash (src); CREATE INDEX tx_data_index ON eth.transaction_cids USING hash (tx_data); -- receipt indexes 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_header_id_index ON eth.receipt_cids USING hash (header_id); CREATE INDEX rct_leaf_cid_index ON eth.receipt_cids USING btree (leaf_cid); CREATE INDEX rct_leaf_mh_block_number_index ON eth.receipt_cids USING btree (leaf_mh_key, block_number); -CREATE INDEX rct_contract_index ON eth.receipt_cids USING btree (contract); +CREATE INDEX rct_contract_index ON eth.receipt_cids USING hash (contract); CREATE INDEX rct_contract_hash_index ON eth.receipt_cids USING btree (contract_hash); -- state node indexes @@ -33,7 +33,7 @@ CREATE INDEX state_block_number_index ON eth.state_cids USING brin (block_number CREATE INDEX state_leaf_key_index ON eth.state_cids USING btree (state_leaf_key); CREATE INDEX state_cid_index ON eth.state_cids USING btree (cid); CREATE INDEX state_mh_block_number_index ON eth.state_cids USING btree (mh_key, block_number); -CREATE INDEX state_header_id_index ON eth.state_cids USING btree (header_id); +CREATE INDEX state_header_id_index ON eth.state_cids USING hash (header_id); CREATE INDEX state_node_type_index ON eth.state_cids USING btree (node_type); -- storage node indexes @@ -42,29 +42,29 @@ CREATE INDEX storage_state_path_index ON eth.storage_cids USING btree (state_pat CREATE INDEX storage_leaf_key_index ON eth.storage_cids USING btree (storage_leaf_key); CREATE INDEX storage_cid_index ON eth.storage_cids USING btree (cid); CREATE INDEX storage_mh_block_number_index ON eth.storage_cids USING btree (mh_key, block_number); -CREATE INDEX storage_header_id_index ON eth.storage_cids USING btree (header_id); +CREATE INDEX storage_header_id_index ON eth.storage_cids USING hash (header_id); CREATE INDEX storage_node_type_index ON eth.storage_cids USING btree (node_type); -- state accounts indexes CREATE INDEX account_block_number_index ON eth.state_accounts USING brin (block_number); -CREATE INDEX account_header_id_index ON eth.state_accounts USING btree (header_id); -CREATE INDEX account_storage_root_index ON eth.state_accounts USING btree (storage_root); +CREATE INDEX account_header_id_index ON eth.state_accounts USING hash (header_id); +CREATE INDEX account_storage_root_index ON eth.state_accounts USING hash (storage_root); -- access list indexes CREATE INDEX access_list_block_number_index ON eth.access_list_elements USING brin (block_number); -CREATE INDEX access_list_element_address_index ON eth.access_list_elements USING btree (address); +CREATE INDEX access_list_element_address_index ON eth.access_list_elements USING hash (address); CREATE INDEX access_list_storage_keys_index ON eth.access_list_elements USING gin (storage_keys); -- log indexes CREATE INDEX log_block_number_index ON eth.log_cids USING brin (block_number); -CREATE INDEX log_header_id_index ON eth.log_cids USING btree (header_id); +CREATE INDEX log_header_id_index ON eth.log_cids USING hash (header_id); CREATE INDEX log_leaf_mh_block_number_index ON eth.log_cids USING btree (leaf_mh_key, block_number); CREATE INDEX log_cid_index ON eth.log_cids USING btree (leaf_cid); -CREATE INDEX log_address_index ON eth.log_cids USING btree (address); -CREATE INDEX log_topic0_index ON eth.log_cids USING btree (topic0); -CREATE INDEX log_topic1_index ON eth.log_cids USING btree (topic1); -CREATE INDEX log_topic2_index ON eth.log_cids USING btree (topic2); -CREATE INDEX log_topic3_index ON eth.log_cids USING btree (topic3); +CREATE INDEX log_address_index ON eth.log_cids USING hash (address); +CREATE INDEX log_topic0_index ON eth.log_cids USING hash (topic0); +CREATE INDEX log_topic1_index ON eth.log_cids USING hash (topic1); +CREATE INDEX log_topic2_index ON eth.log_cids USING hash (topic2); +CREATE INDEX log_topic3_index ON eth.log_cids USING hash (topic3); CREATE INDEX log_data_index ON eth.log_cids USING hash (log_data); -- +goose Down