BRIN => BTREE

This commit is contained in:
i-norden 2023-02-20 13:47:23 -06:00
parent 5e153c601f
commit a710db0284
2 changed files with 18 additions and 18 deletions

View File

@ -1,30 +1,30 @@
-- +goose Up
-- header indexes
CREATE INDEX header_block_number_index ON eth.header_cids USING brin (block_number);
CREATE INDEX header_block_number_index ON eth.header_cids USING btree (block_number);
CREATE UNIQUE INDEX header_cid_block_number_index ON eth.header_cids USING btree (cid, block_number);
CREATE INDEX state_root_index ON eth.header_cids USING btree (state_root);
CREATE INDEX timestamp_index ON eth.header_cids USING brin (timestamp);
CREATE INDEX timestamp_index ON eth.header_cids USING btree (timestamp);
-- uncle indexes
CREATE INDEX uncle_block_number_index ON eth.uncle_cids USING brin (block_number);
CREATE INDEX uncle_block_number_index ON eth.uncle_cids USING btree (block_number);
CREATE UNIQUE INDEX uncle_cid_block_number_index ON eth.uncle_cids USING btree (cid, block_number);
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_block_number_index ON eth.transaction_cids USING btree (block_number);
CREATE INDEX tx_header_id_index ON eth.transaction_cids USING btree (header_id);
CREATE INDEX tx_cid_block_number_index ON eth.transaction_cids USING btree (cid, 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);
-- receipt indexes
CREATE INDEX rct_block_number_index ON eth.receipt_cids USING brin (block_number);
CREATE INDEX rct_block_number_index ON eth.receipt_cids USING btree (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);
-- state node indexes
CREATE INDEX state_block_number_index ON eth.state_cids USING brin (block_number);
CREATE INDEX state_block_number_index ON eth.state_cids USING btree (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_removed_index ON eth.state_cids USING btree (removed);
@ -32,7 +32,7 @@ CREATE INDEX state_code_hash_index ON eth.state_cids USING btree (code_hash); --
CREATE INDEX state_leaf_key_block_number_index ON eth.state_cids(state_leaf_key, block_number DESC);
-- storage node indexes
CREATE INDEX storage_block_number_index ON eth.storage_cids USING brin (block_number);
CREATE INDEX storage_block_number_index ON eth.storage_cids USING btree (block_number);
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);
@ -40,12 +40,12 @@ 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);
-- access list indexes
CREATE INDEX access_list_block_number_index ON eth.access_list_elements USING brin (block_number);
CREATE INDEX access_list_block_number_index ON eth.access_list_elements USING btree (block_number);
CREATE INDEX access_list_element_address_index ON eth.access_list_elements USING btree (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_block_number_index ON eth.log_cids USING btree (block_number);
CREATE INDEX log_header_id_index ON eth.log_cids USING btree (header_id);
CREATE INDEX log_cid_block_number_index ON eth.log_cids USING btree (cid, block_number);
CREATE INDEX log_address_index ON eth.log_cids USING btree (address);

View File

@ -566,7 +566,7 @@ ALTER TABLE ONLY public.nodes
-- Name: access_list_block_number_index; Type: INDEX; Schema: eth; Owner: -
--
CREATE INDEX access_list_block_number_index ON eth.access_list_elements USING brin (block_number);
CREATE INDEX access_list_block_number_index ON eth.access_list_elements USING btree (block_number);
--
@ -587,7 +587,7 @@ CREATE INDEX access_list_storage_keys_index ON eth.access_list_elements USING gi
-- Name: header_block_number_index; Type: INDEX; Schema: eth; Owner: -
--
CREATE INDEX header_block_number_index ON eth.header_cids USING brin (block_number);
CREATE INDEX header_block_number_index ON eth.header_cids USING btree (block_number);
--
@ -608,7 +608,7 @@ CREATE INDEX log_address_index ON eth.log_cids USING btree (address);
-- Name: log_block_number_index; Type: INDEX; Schema: eth; Owner: -
--
CREATE INDEX log_block_number_index ON eth.log_cids USING brin (block_number);
CREATE INDEX log_block_number_index ON eth.log_cids USING btree (block_number);
--
@ -657,7 +657,7 @@ CREATE INDEX log_topic3_index ON eth.log_cids USING btree (topic3);
-- Name: rct_block_number_index; Type: INDEX; Schema: eth; Owner: -
--
CREATE INDEX rct_block_number_index ON eth.receipt_cids USING brin (block_number);
CREATE INDEX rct_block_number_index ON eth.receipt_cids USING btree (block_number);
--
@ -685,7 +685,7 @@ CREATE INDEX rct_header_id_index ON eth.receipt_cids USING btree (header_id);
-- Name: state_block_number_index; Type: INDEX; Schema: eth; Owner: -
--
CREATE INDEX state_block_number_index ON eth.state_cids USING brin (block_number);
CREATE INDEX state_block_number_index ON eth.state_cids USING btree (block_number);
--
@ -734,7 +734,7 @@ CREATE INDEX state_root_index ON eth.header_cids USING btree (state_root);
-- Name: storage_block_number_index; Type: INDEX; Schema: eth; Owner: -
--
CREATE INDEX storage_block_number_index ON eth.storage_cids USING brin (block_number);
CREATE INDEX storage_block_number_index ON eth.storage_cids USING btree (block_number);
--
@ -776,14 +776,14 @@ CREATE INDEX storage_state_leaf_key_index ON eth.storage_cids USING btree (state
-- Name: timestamp_index; Type: INDEX; Schema: eth; Owner: -
--
CREATE INDEX timestamp_index ON eth.header_cids USING brin ("timestamp");
CREATE INDEX timestamp_index ON eth.header_cids USING btree ("timestamp");
--
-- Name: tx_block_number_index; Type: INDEX; Schema: eth; Owner: -
--
CREATE INDEX tx_block_number_index ON eth.transaction_cids USING brin (block_number);
CREATE INDEX tx_block_number_index ON eth.transaction_cids USING btree (block_number);
--
@ -818,7 +818,7 @@ CREATE INDEX tx_src_index ON eth.transaction_cids USING btree (src);
-- Name: uncle_block_number_index; Type: INDEX; Schema: eth; Owner: -
--
CREATE INDEX uncle_block_number_index ON eth.uncle_cids USING brin (block_number);
CREATE INDEX uncle_block_number_index ON eth.uncle_cids USING btree (block_number);
--