Servicenow Indexing - Dot walking
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2023 10:17 PM
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();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2023 10:36 PM
@Surendra Deshmu The code you added should work.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2023 01:31 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2023 01:45 AM
@Surendra Deshmu As per my knowledge indexing will help in finding the record on UI not in script.
ServiceNow Community Rising Star, Class of 2023