You can drop the index on col_a
. PostgreSQL can use a combined index if you request col_a
, and you can also use an index if you request col_a
and col_b
. These types of queries can use a combined index:
WHERE col_a = 'val' WHERE col_a = 'val' AND col_b = 'val'
The combined index cannot be used to query only col_b
or OR
transition col_a
and col_b
. Thus, an extra index over col_b
might make sense if you often request only col_b
.
Edit: So: you have no advantage in creating index_on_col_a
, but you have a lower write speed. Throw it.
source share