Yes, it was one of the table RetailGroupLineMember which is not getting populated in our case correctly. Following is the solution we got from MICROSOFT.
SUMMARY OF TROUBLESHOOTING
=============================
We found that the performance bottleneck was due to a combination of the data volume of RetailGroupMemberLine table (in that case there’re 1M rows in the same table), and the way how RetailGroupMemberLine node is specified in the out-of-box Table Distribution.
The net result is that CDX queries contain link condition such as this:
RetailGroupMemberLine.Product = EcoResProduct.RecId OR RetailGroupMemberLine.Variant = EcoResProduct.RecId
As an example, you may find one in class RetailCDXChannelSpecificData_AX63, method d_RetailGroupMemberLine_109:
insert_recordset ref2 (RefTableId, RefRecId)
select tid, RecId
from t7
group by RecId
join t6
where ((t7.Product==t6.RecId) || (t7.Variant==t6.RecId))
join t5
where ((t6.RecId==t5.DistinctProductVariant))
The OR condition causes the CDX generated queries to run very slowly, given the data volume of RetailGroupMemberLine table rows.
The solution only involves configuration change on the AX side. No code or hotfix is required.
They are:
1. Customize the Table Distribution, by re-arranging RetailGroupMemberLine nodes in the XML definition. The net effect is that CDX generated query will not have the OR condition. This change has no negative effect. There will be no data loss. Full sync or delta sync will continue to work for this table. The exact procedures involved are:
a. Open Retail -> Setup -> Retail scheduler -> Retail channel schema
b. Pick AX 2012 R3
c. Click “Select all” button in “Retail data distribution” table, hit “Ctrl+C” to copy the content to clipboard.
d. Open any text editor and:
i. Paste the content from clipboard.
ii. Find nodes like below – there should be 2 finding results:
<Table name="RetailGroupMemberLine">
<LinkGroup>
<Link type="FieldMatch" fieldName="Product" parentFieldName="RecId" />
</LinkGroup>
<LinkGroup>
<Link type="FieldMatch" fieldName="Variant" parentFieldName="RecId" />
</LinkGroup>
<Table name="RetailSpecialCategoryMember">
<LinkGroup>
<Link type="FieldMatch" fieldName="RetailGroupMember" parentFieldName="RecId" />
</LinkGroup>
</Table>
</Table>
iii. Remove the highlighted section for field Variant.
iv. Hit “Ctrl+A” and then “Ctrl+C” to copy the whole changed content.
e. Back to Retail channel schema form, hit “Delete” button to clear the content, hit “Ctrl+V” to paste changed content.
f. “Ctrl+S” to save
g. Click “Generate classes” button
h. Make sure class generation completes without error (info log pops up as notice for IL generation completed)
execute the below statements at AX DB side .
create nonclustered index RETAILGROUPMEMBERLINE_index1
on RETAILGROUPMEMBERLINE (partition) include (PRODUCT ,RECID)
create nonclustered index RETAILGROUPMEMBERLINE_index2
on RETAILGROUPMEMBERLINE (PRODUCT ,partition) include (RECID)