Нашел очень интересную kb:
2844240 - Last Review: May 9, 2013
You experience slow performance when you run the X++ compilation in Microsoft Dynamics AX 2012 R2
When you run the X++ compilation in Microsoft Dynamics AX 2012 R2, you experience slow performance.
This problem occurs because the SQL Query Optimizer might not calculate the optimal query path for one of the frequent queries against the ModelSecurityPermission model store table. This happens because of an added Primary Key for this table in Microsoft Dynamics AX 2012 R2 and when it happens, it a causes a significant performance penalty.
Чего делать с этим - сами догадаетесь, ибо выкладывать hotfix - MS обидится.
Пролетало и на форуме:
axtools: AX2012 R2 hotfix available to improve compile speed