Failed to create a unique index in the [incident] table

Qyc
Tera Contributor

I have created two new fields in the [incident] table, and I want to use these fields to create a unique index, but failed.And reported the following error:

An index with multiple fields (u_col1,u_col2) of which at least one is glommed cannot be part of a unique constraint

 

I have reviewed the official documentation about index, but the information is limited and I have not been able to find a solution.How can I solve this problem?

1 REPLY 1

Hayo Lubbers
Kilo Sage

Hi @Qyc ,

 

Have a look at the KB : https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0723580

 

Here the glomming is explained:

What is glomming?

The concept of glomming applies to TPH tables and it allows multiple logical elements that do not have any direct relationship (sibling and cousin elements) to be mapped to a single physical storage column in the task table. Glomming helps to mitigate DB limitations such as 64 KB static row size, 100 column hard limit, 64 max index on a table. There is glomming with TPP for CMDB however, there is a slight difference in that TPP requires storage aliases for every table that inherits a field from the base table where the field was added, while with TPC the storage alias is only specified for the table where a field is added.

 

If I understand correctly, the column u_col1, u_col2 or any other column used in your index is re-used on database level by another (not incident related) task table column to prevent (other) database limitations.

 

A workaround could be a business rule checking for duplicates (GlideAggregate with the correct query and checking is the result is 0).

 

Hope this helps,

Hayo