indexes on receipt cid and mh_key should not be unique, as it is possible (but improbable) that two receipts can be identical

This commit is contained in:
i-norden 2022-02-16 14:04:57 -06:00
parent 16e17abb7e
commit f59582ab42
3 changed files with 8 additions and 8 deletions

View File

@ -17,8 +17,8 @@ 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 UNIQUE INDEX rct_leaf_cid_index ON eth.receipt_cids USING btree (leaf_cid);
CREATE UNIQUE INDEX rct_leaf_mh_index ON eth.receipt_cids USING btree (leaf_mh_key);
CREATE INDEX rct_leaf_cid_index ON eth.receipt_cids USING btree (leaf_cid);
CREATE INDEX rct_leaf_mh_index ON eth.receipt_cids USING btree (leaf_mh_key);
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);

View File

@ -17,8 +17,8 @@ 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 UNIQUE INDEX rct_leaf_cid_index ON eth.receipt_cids USING btree (leaf_cid);
CREATE UNIQUE INDEX rct_leaf_mh_index ON eth.receipt_cids USING btree (leaf_mh_key);
CREATE INDEX rct_leaf_cid_index ON eth.receipt_cids USING btree (leaf_cid);
CREATE INDEX rct_leaf_mh_index ON eth.receipt_cids USING btree (leaf_mh_key);
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);

View File

@ -626,14 +626,14 @@ CREATE INDEX block_number_index ON eth.header_cids USING brin (block_number);
-- Name: header_cid_index; Type: INDEX; Schema: eth; Owner: -
--
CREATE INDEX header_cid_index ON eth.header_cids USING btree (cid);
CREATE UNIQUE INDEX header_cid_index ON eth.header_cids USING btree (cid);
--
-- Name: header_mh_index; Type: INDEX; Schema: eth; Owner: -
--
CREATE INDEX header_mh_index ON eth.header_cids USING btree (mh_key);
CREATE UNIQUE INDEX header_mh_index ON eth.header_cids USING btree (mh_key);
--
@ -815,7 +815,7 @@ CREATE INDEX timestamp_index ON eth.header_cids USING brin ("timestamp");
-- Name: tx_cid_index; Type: INDEX; Schema: eth; Owner: -
--
CREATE INDEX tx_cid_index ON eth.transaction_cids USING btree (cid);
CREATE UNIQUE INDEX tx_cid_index ON eth.transaction_cids USING btree (cid);
--
@ -836,7 +836,7 @@ CREATE INDEX tx_header_id_index ON eth.transaction_cids USING btree (header_id);
-- Name: tx_mh_index; Type: INDEX; Schema: eth; Owner: -
--
CREATE INDEX tx_mh_index ON eth.transaction_cids USING btree (mh_key);
CREATE UNIQUE INDEX tx_mh_index ON eth.transaction_cids USING btree (mh_key);
--