Skip to main content

New answers tagged

1 vote

Are unique filtered indexes considered an antipattern for enforcing constraints?

The example is a bit odd. You have FoolID which I would expect to be the primary key of the table. Making it kind of a filtered primary key doesn't seem right. Using a filtered index to ensure that ...
David Wiseman's user avatar
11 votes
Accepted

Are unique filtered indexes considered an antipattern for enforcing constraints?

They are not quite considered an anti-pattern, but they are to some extent a denormalization. Under very strict 6th Normal Form rules, you should really take out that bit column and instead make a ...
Charlieface's user avatar
  • 13.7k
2 votes

Are unique filtered indexes considered an antipattern for enforcing constraints?

A more realistic use than a table of fools, would be a certain style of table with versioned rows, where the current row is marked. There can, of course, be only one current row, and there needs to be ...
Steve's user avatar
  • 549
0 votes

Performance of single vs multiple column unique constraint

According to the postgresql documentation here, single column indexes are preferred for performance reasons: Multicolumn indexes should be used sparingly. In most situations, an index on a single ...
Parker H Gordon's user avatar

Top 50 recent answers are included