Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Indexing the reference field

Uma Udikeri
Tera Contributor

Hi All,

 

I am trying to index my statement field which is a reference field on the sn_risk_risk table but its not happening is it because its an reference field ? or is it because it has a large amount of data.

 

Thanks,

Uma

3 REPLIES 3

swathisarang98
Giga Sage

Hi @Uma Udikeri ,

 

If there are large number of data is present try adding reference qualifier to remove unrelated and unwanted data then try if it doesn't work please let me know or share some screen shots 

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

Hi Swathi,

 

You mean reference qualifier at the field level , it will not reduce the data since its referencing to risk. So wanted to check can we add index to this risk reference on the other table.

 

Thanks,

Uma

Lyle Taylor
Tera Expert

I think you might be looking at it at the wrong level. All reference fields already have an index for them, but that index is for the value of that field, which is simply a sys_id. So, you can efficiently find all records in sn_risk_risk that reference a given record in the table being reference. But that doesn't help you efficiently look up a record to reference (e.g., looking up a user for to fill in the assigned_to field).

 

If what you're actually looking for is an efficient way to lookup the record you want to reference, then you need to look at configuring your search options for the table being referenced and look at potentially adding indexes to that table instead of your reference field. For example, if you're searching based on name, make sure that the name field in the target table is indexed.

 

Note that a contains search will never use indexes unless you have configured full text search (or maybe AI search?).