I have the following structure.
CREATE TABLE join_table (
id integer NOT NULL,
col_a integer NOT NULL,
col_b integer NOT NULL
)
CREATE INDEX index_on_col_a ON join_table USING btree (col_a);
CREATE INDEX index_on_col_b ON join_table USING btree (col_b);
CREATE UNIQUE INDEX index_on_col_a_and_col_b ON join_table USING btree (col_a, col_b);
There are also foreign keys on col_a and col_b.
Clearly index_on_col_a
is no longer needed,
but is there a cost or benefit to keeping or deleting it?
My guess is;
- keeping it will slow down inserts
- selects using just
col_a
may be faster if I keep it