Skip to content

Commit

Permalink
indexer: remove unnecessary column index (MystenLabs#10114)
Browse files Browse the repository at this point in the history
  • Loading branch information
gegaowp authored Mar 30, 2023
1 parent bce0c14 commit 8059d72
Showing 4 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ CREATE TABLE transactions (
checkpoint_sequence_number BIGINT,
timestamp_ms BIGINT,
transaction_kind TEXT NOT NULL,
transaction_count BIGINT NOT NULL,
transaction_count BIGINT NOT NULL,
-- object related
created TEXT[] NOT NULL,
mutated TEXT[] NOT NULL,
@@ -53,5 +53,4 @@ CREATE TABLE transactions (
CREATE INDEX transactions_transaction_digest ON transactions (transaction_digest);
CREATE INDEX transactions_timestamp_ms ON transactions (timestamp_ms);
CREATE INDEX transactions_sender ON transactions (sender);
CREATE INDEX transactions_gas_object_id ON transactions (gas_object_id);
CREATE INDEX transactions_checkpoint_sequence_number ON transactions (checkpoint_sequence_number);
Original file line number Diff line number Diff line change
@@ -5,5 +5,3 @@ CREATE TABLE addresses
first_appearance_time BIGINT NOT NULL
);
CREATE INDEX addresses_account_address ON addresses (account_address);
CREATE INDEX addresses_first_appearance_tx ON addresses (first_appearance_tx);
CREATE INDEX addresses_first_appearance_time ON addresses (first_appearance_time);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CREATE TABLE checkpoints
(
sequence_number BIGINT PRIMARY KEY,
sequence_number BIGINT PRIMARY KEY,
checkpoint_digest VARCHAR(255) NOT NULL,
epoch BIGINT NOT NULL,
transactions TEXT[] NOT NULL,
@@ -20,5 +20,4 @@ CREATE TABLE checkpoints
);

CREATE INDEX checkpoints_epoch ON checkpoints (epoch);
CREATE INDEX checkpoints_timestamp ON checkpoints (timestamp_ms);
CREATE INDEX checkpoints_checkpoint_digest ON checkpoints (checkpoint_digest);
CREATE INDEX checkpoints_timestamp ON checkpoints (timestamp_ms);
Original file line number Diff line number Diff line change
@@ -9,10 +9,9 @@ CREATE TABLE move_calls (
move_function TEXT NOT NULL
);
CREATE INDEX move_calls_transaction_digest ON move_calls (transaction_digest);
CREATE INDEX move_calls_checkpoint_sequence_number ON move_calls (checkpoint_sequence_number);
CREATE INDEX move_calls_epoch ON move_calls (epoch);
CREATE INDEX move_calls_sender ON move_calls (sender);
CREATE INDEX move_calls_move_function ON move_calls (move_package, move_module, move_function);
CREATE INDEX move_calls_move_package ON move_calls (move_package);
CREATE INDEX move_calls_move_module ON move_calls (move_module);
CREATE INDEX move_calls_move_function ON move_calls (move_function);

CREATE TABLE recipients (
id BIGSERIAL PRIMARY KEY,
@@ -22,10 +21,7 @@ CREATE TABLE recipients (
sender address NOT NULL,
recipient address NOT NULL
);

CREATE INDEX recipients_transaction_digest ON recipients (transaction_digest);
CREATE INDEX recipients_checkpoint_sequence_number ON recipients (checkpoint_sequence_number);
CREATE INDEX recipients_epoch ON recipients (epoch);
CREATE INDEX recipients_recipient ON recipients (recipient);

CREATE TABLE input_objects (
@@ -36,9 +32,5 @@ CREATE TABLE input_objects (
object_id address NOT NULL,
object_version BIGINT
);

CREATE INDEX input_objects_transaction_digest ON input_objects (transaction_digest);
CREATE INDEX input_objects_checkpoint_sequence_number ON input_objects (checkpoint_sequence_number);
CREATE INDEX input_objects_epoch ON input_objects (epoch);
CREATE INDEX input_objects_object_id ON input_objects (object_id);
CREATE INDEX input_objects_object_version ON input_objects (object_version);

0 comments on commit 8059d72

Please sign in to comment.