Is it considered bad practice to have a UNIQUE constraint applying to all columns on a table, essentially enforcing unique rows?
My use case is to store tokens from textual message from various sources, tracking the ID of each message. There can be many tokens per message, and IDs may clash from various sources.
I want to
DO NOTHING in the case of reading the same message multiple times, rather than removing duplicates after the fact. I also want to be able to quickly access the tokens for any particular message, hence indexing on
(source,id). Is something like the below a good design for this purpose?
source | id | token --------------------- x | 1 | token_1 x | 1 | token_2 y | 1 | token_3 y | 2 | token_1 idx (source, id) pk (source, id, token)