updates order of columns in compound PKs, update indexes e.g. we don't need a btree index on a column if it is the first column in the compound PK index but we do need a btree index for the later columns in a compound PK (searches on first column of a compound index are just as fast as searches on a btree index for that column alone, but searches on the 2nd or 3rd column in a compound index are significantly slower than on dedicated indexes)

This commit is contained in:
i-norden
2022-03-28 18:22:57 -05:00
parent 82de252160
commit da8d0af6df
8 changed files with 57 additions and 53 deletions
@@ -1,7 +1,7 @@
-- +goose Up
CREATE TABLE IF NOT EXISTS public.blocks (
block_number BIGINT NOT NULL,
key TEXT UNIQUE NOT NULL,
key TEXT NOT NULL,
data BYTEA NOT NULL,
PRIMARY KEY (key, block_number)
);