What is the best way to create an index as well as unique constraint on a schema like below?
Most of my queries will filter based on date
column. If I create single column index on date
and a unique constraint including both (date and key), I end up creating two indices as unique constraint also creates an index.
Is there a better way around this?
date | key | value |
---|---|---|
12-12-2021 | a | 3 |
12-12-2021 | b | 4 |
12-13-2021 | a | 3 |
12-13-2021 | b | 4 |