From d2920e7acf923efa0c778ef7f263076765f56c1e Mon Sep 17 00:00:00 2001 From: Matt K <1036969+mkrump@users.noreply.github.com> Date: Wed, 1 Nov 2017 08:52:04 -0500 Subject: [PATCH] Add index on block_number column (#43) --- migrations/1509484288_add_block_index.down.sql | 1 + migrations/1509484288_add_block_index.up.sql | 1 + migrations/schema.sql | 7 +++++++ 3 files changed, 9 insertions(+) create mode 100644 migrations/1509484288_add_block_index.down.sql create mode 100644 migrations/1509484288_add_block_index.up.sql diff --git a/migrations/1509484288_add_block_index.down.sql b/migrations/1509484288_add_block_index.down.sql new file mode 100644 index 00000000..9a1d42fb --- /dev/null +++ b/migrations/1509484288_add_block_index.down.sql @@ -0,0 +1 @@ +DROP INDEX block_number_index; \ No newline at end of file diff --git a/migrations/1509484288_add_block_index.up.sql b/migrations/1509484288_add_block_index.up.sql new file mode 100644 index 00000000..a4710b9c --- /dev/null +++ b/migrations/1509484288_add_block_index.up.sql @@ -0,0 +1 @@ +CREATE INDEX block_number_index ON blocks (block_number); diff --git a/migrations/schema.sql b/migrations/schema.sql index 2c938aa5..83dd2c59 100644 --- a/migrations/schema.sql +++ b/migrations/schema.sql @@ -149,6 +149,13 @@ ALTER TABLE ONLY transactions ADD CONSTRAINT transactions_pkey PRIMARY KEY (id); +-- +-- Name: block_number_index; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX block_number_index ON blocks USING btree (block_number); + + -- -- Name: transactions fk_test; Type: FK CONSTRAINT; Schema: public; Owner: - --