Skip to content

Commit 69e930b

Browse files
TerryTerry
authored andcommitted
add index for fevm tables
1 parent c74c69c commit 69e930b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

schemas/v1/28_fevm_table_index.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package v1
2+
3+
func init() {
4+
patches.Register(
5+
28,
6+
`
7+
-- fevm_block_headers
8+
CREATE INDEX IF NOT EXISTS fevm_block_headers_height_idx ON {{ .SchemaName | default "public"}}.fevm_block_headers USING BTREE (height);
9+
CREATE INDEX IF NOT EXISTS fevm_block_headers_hash_idx ON {{ .SchemaName | default "public"}}.fevm_block_headers USING HASH (hash);
10+
11+
-- fevm_receipts
12+
CREATE INDEX IF NOT EXISTS fevm_receipts_height_idx ON {{ .SchemaName | default "public"}}.fevm_receipts USING BTREE (height);
13+
CREATE INDEX IF NOT EXISTS fevm_receipts_from_idx ON {{ .SchemaName | default "public"}}.fevm_receipts USING HASH ("from");
14+
CREATE INDEX IF NOT EXISTS fevm_receipts_to_idx ON {{ .SchemaName | default "public"}}.fevm_receipts USING HASH ("to");
15+
16+
-- fevm_contracts
17+
CREATE INDEX IF NOT EXISTS fevm_contracts_height_idx ON {{ .SchemaName | default "public"}}.fevm_contracts USING BTREE (height);
18+
CREATE INDEX IF NOT EXISTS fevm_contracts_actor_id_idx ON {{ .SchemaName | default "public"}}.fevm_contracts USING HASH (actor_id);
19+
CREATE INDEX IF NOT EXISTS fevm_contracts_eth_address_idx ON {{ .SchemaName | default "public"}}.fevm_contracts USING HASH (eth_address);
20+
21+
-- fevm_transactions
22+
CREATE INDEX IF NOT EXISTS fevm_transactions_height_idx ON {{ .SchemaName | default "public"}}.fevm_transactions USING BTREE (height);
23+
CREATE INDEX IF NOT EXISTS fevm_transactions_from_idx ON {{ .SchemaName | default "public"}}.fevm_transactions USING HASH ("from");
24+
CREATE INDEX IF NOT EXISTS fevm_transactions_to_idx ON {{ .SchemaName | default "public"}}.fevm_transactions USING HASH ("to");
25+
`,
26+
)
27+
}

0 commit comments

Comments
 (0)