Skip to main content
Solved

Drawback of using unique index on column

  • December 11, 2019
  • 2 replies
  • 135 views

Forum|alt.badge.img+2

Although I didn’t learn about this in my standard SF training I recently found out that there is a way in the SF to make a column unique by creating a unique index. See picture below:

 

I wonder if this is common practice when one needs a value in a column to be unique? Are there any drawbacks that I have to take into account?

I also wonder why this option isn’t available when creating the column?

Best answer by Anne Buit

Hi Dennis,

There is one caveat: null-values are included when determining uniqueness. Thinkwise Platform 2018.3 and up allow you to specify that null-values should be ignored when determining the uniqueness.

You also have to keep in mind that the uniqueness is checked before any trigger logic is executed. Ensuring uniqueness in the trigger logic is not an option.

If this settings would be configured at column-level, it would be more difficult to specify that a combination of columns must contain unique values. The index allows you to select multiple columns. However, for a single unique column I'd agree that this could just as well be available at the column itself.

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

2 replies

Anne Buit
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 634 replies
  • Answer
  • December 11, 2019

Hi Dennis,

There is one caveat: null-values are included when determining uniqueness. Thinkwise Platform 2018.3 and up allow you to specify that null-values should be ignored when determining the uniqueness.

You also have to keep in mind that the uniqueness is checked before any trigger logic is executed. Ensuring uniqueness in the trigger logic is not an option.

If this settings would be configured at column-level, it would be more difficult to specify that a combination of columns must contain unique values. The index allows you to select multiple columns. However, for a single unique column I'd agree that this could just as well be available at the column itself.


Forum|alt.badge.img+2
  • Author
  • Vanguard
  • 22 replies
  • December 11, 2019

Thanks for these details! And the prompt answer :thumbsup_tone1: .


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings