Servicenow Indexing - Dot walking

Surendra Deshmu
Tera Contributor

Hello All,

 

How does indexing work in case of query condition where dot walking is used?

 

eg.

var a = new GlideRecord('tablename');

a.addQuery('field.field2.field3',true);

a.query();

3 REPLIES 3

jaheerhattiwale
Mega Sage
Mega Sage

@Surendra Deshmu The code you added should work.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

Hello Jaheer,

Thanks for replying.

Actually my question was from query optimisation perspective.

How can we configure indexing on respective tables while we have dot walking in query condition?

suppose in given script field1 is mentioned in index for table. But field 1 is also reference field referring to some other table where field2 is not mentioned in index record for table. So will this query be considered as optimised query. Or do we have to mention field2 as index in table which field1 is referring to?

@Surendra Deshmu As per my knowledge indexing will help in finding the record on UI not in script.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023