Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

UPDATE T1 SET DEPENDENTSUBLEDGERJOURNALACCOUNTENTRY - This query never ends and causes deadlocks on the DB

$
0
0

Hi all, 

I'm at a dead end with this one. I have an issue with 3 AX SQL queries.

We regularly see these queries running throughout the day. They never seems to end. The impact on the DB is huge - causing multiple deadlocks and renders AX largely unusable. 

The first query is

UPDATE T1 SET DEPENDENTSUBLEDGERJOURNALACCOUNTENTRY=T2.RECID,DEPENDENTACCOUNTINGDATE=T3.ACCOUNTINGDATE,RECVERSION=@P1 FROM tempdb."DBO".t108350_AB3E356E44A942DEB83CAAD8C2C0893F T1 CROSS JOIN SUBLEDGERJOURNALACCOUNTENTRY T2 CROSS JOIN tempdb."DBO".t7461_29EDFC91A8334C028C79B756BBE45AD0 T3 WHERE (T1.PARTITION=5637144576) AND ((T2.PARTITION=5637144576) AND ((((((((((((T2.EXCHANGERATE1=T1.EXCHANGERATE1) AND (T2.EXCHANGERATE2=T1.EXCHANGERATE2)) AND (T2.EXCHANGERATEDATE=T1.EXCHANGERATEDATE)) AND (T2.HISTORICALEXCHANGERATEDATE=T1.HISTORICALEXCHANGERATEDATE)) AND (T2.ISCORRECTION=T1.ISCORRECTION)) AND (T2.LEDGERDIMENSION=T1.LEDGERDIMENSION)) AND (T2.ORIGINALTRANSFERPOLICY=T1.ORIGINALTRANSFERPOLICY)) AND (T2.POSTINGTYPE=T1.POSTINGTYPE)) AND (T2.REPORTINGEXCHANGERATE1=T1.REPORTINGEXCHANGERATE1)) AND (T2.REPORTINGEXCHANGERATE2=T1.REPORTINGEXCHANGERATE2)) AND (T2.SIDE=T1.SIDE)) AND (T2.TRANSACTIONCURRENCY=T1.TRANSACTIONCURRENCY))) AND ((T3.PARTITION=5637144576) AND (T3.SUBLEDGERJOURNALENTRY=T2.SUBLEDGERJOURNALENTRY))

the second query is

UPDATE ACCOUNTINGEVENT SET STATE=@P1,RECVERSION=@P2 WHERE ((PARTITION=5637144576) AND (STATE=@P3)) AND EXISTS (SELECT 'x' FROM SUBLEDGERJOURNALENTRY T2 WHERE ((T2.PARTITION=5637144576) AND (((T2.ACCOUNTINGEVENT=ACCOUNTINGEVENT.RECID) AND (T2.TRANSFERID=@P4)) AND (T2.LEDGER=@P5))) AND NOT (EXISTS (SELECT 'x' FROM SUBLEDGERJOURNALENTRY T3 WHERE ((T3.PARTITION=5637144576) AND (((T3.ACCOUNTINGEVENT=T2.ACCOUNTINGEVENT) AND (T3.STATUS<>@P6)) AND (T3.LEDGER<>T2.LEDGER))))))

From what I can gather these are standard AX queries executed around invoice posting. We have Dynamics Perf installed and configured and the results from Perf also show these queries. However according to the Perf data - this query is the most problematic.

DELETE FROM VENDPAYMSCHEDLINE WHERE ((RECID=@P1) AND (RECVERSION=@P2))

Any help to point me in the right direction would be hugely appreciated. 

Thanks team, 

D


Viewing all articles
Browse latest Browse all 72043

Trending Articles