Skip to main content
Inspiring
September 28, 2026
Question

Replacing Nested CDT With Query Sync Records and Record Relationships

  • September 28, 2026
  • 2 replies
  • 11 views

HI everyone, 

I’m having a nested CDT that takes quite some times to query data. Thus, I though replacing it with query sync records using relationships between them can be a more time efficient solution. Below is how my record query looks like: 

a!queryRecordType(
recordType: 'recordType!AAA CF Check List Instance SR',
filters: a!queryLogicalExpression(
operator: a!defaultValue(ri!filterOperator, "AND"),
logicalExpressions: ri!logicalExpression,
ignoreFiltersWithEmptyValues: true,
filters: append(
{
a!queryFilter(
field: 'recordType!AAA CF Check List Instance SR.fields.isactive',
operator: "=",
value: ri!isActive
),
a!queryFilter(
field: 'recordType!AAA CF Check List Instance SR.fields.checkListInstanceId',
operator: "in",
value: ri!id
),
a!queryFilter(
field: 'recordType!AAA CF Check List Instance SR.fields.checkListId',
operator: "in",
value: ri!checklistId
),
a!queryFilter(
field: 'recordType!AAA CF Check List Instance SR.fields.entityId',
operator: "in",
value: ri!entityId
),
a!queryFilter(
field: 'recordType!AAA CF Check List Instance SR.fields.entityName',
operator: "in",
value: ri!entityName
)
},
ri!filters
)
),
fields: {a!selectionFields(
allFieldsFromRecordType:
'recordType!AAA CF Check List Instance SR')
,
a!selectionFields(
allFieldsFromRecordType:
recordType!AAA CF Check List Instance SR.relationships.aaaCfCheckListItemInstanceSr''),
a!selectionFields(
allFieldsFromRecordType:
''recordType!AAA CF Check List Instance SR.relationships.aaaCfCheckListItemInstanceSr.relationships.aaaRdCheckListItemSr''),
a!selectionFields(
allFieldsFromRecordType:
''recordType!AAA CF Check List Instance SR.relationships.aaaCfCheckListItemInstanceSr.relationships.aaaRdCheckListItemSr.relationships.item'')}
,
pagingInfo: if(
isnull(ri!pagingInfo),
a!pagingInfo(startIndex: 1, batchSize: 1000),
ri!pagingInfo
),
fetchTotalCount: ri!fetchTotalCount,
relatedRecordData: ri!relatedRecordData
).data

However the record type query is much slower than the nested CDT query, even without selecting all fields and only get some of the fields can take double the time. 

Do you have any other suggestion about what can I do to either reduce time querying nested CDT or replace it with a more suitable solution?

Thank you

2 replies

Inspiring
September 28, 2026

1. Use the selectFields parameter in a!selectionFields() to retrieve only the specific fields required from the related record type.
2. Make sure Sync is enabled -If Sync is not enabled, ensure the fields used in your filters (checkListInstanceId, checkListId, entityId, isActive) are indexed in the database.
3. Avoid using fetchTotalCount: true unless the total record count is actually required.
4. Reduce the default batchSize: 1000.
5. Use Query Performance Logs / Appian Performance Logs to identify RC.

stefanhelzle0001
Brainy
September 28, 2026

Did you enable sync for all the records?

Is there any record-level security set up?