Skip to main content What is Dynamics 365? Guided tours Customer stories Try our products CRM ERP Sales Service Sales Customer Insights Customer Service Contact Center Field Service Supply Chain Management Commerce Finance Project Operations Human Resources Business Central Pricing Business application topics Training & certifications Migrate to the cloud Documentation Events Dynamics 365 Blog Product updates Onboarding and implementation Community Find a partner Software Development Companies Partner resources Microsoft Marketplace Product documentation Technical support On-premises product support Contact us Try for free Sign in
  • 1 min read

Microsoft Dynamics AX general performance analysis scripts page 8


This is page 8 of 8 of the general performance analysis scripts online for the Performance Analyser 1.20 tool. See page 1 for the introduction. Use the links in the table below to navigate between pages.

– General analysis

Analyse SQL Configuration

Page 1
Analyse SQL IndexesPage 2
Analyse SQL QueriesPage 3
Analyse BlockingPage 4
Baseline – benchmark queriesPage 5
– AX Specific
Analyse AX ConfigurationPage 6
Analyse AX IndexesPage 7
Analyse AX QueriesPage 8

Analyse AX Queries

AX_LONG_RUNNING_QUERY_TRACE
HIDDEN_SCANS_QUERIES
OPTION_FAST_QUERIES
USER_SCANS_QUERY


—   AX_LONG_RUNNING_QUERY_TRACE

— ————————————————————–
— Find long running queries from Dynamics AX with source code
— requires client tracing being enabled on the AOS configuration
—————————————————————-

SELECT TOP 100 [CREATED_DATETIME],[DATABASE_NAME],[ROW_NUM], [AX_USER_ID], [SQL_DURATION], [SQL_TEXT], [CALL_STACK], [TRACE_CATEGORY], [TRACE_EVENT_CODE], [TRACE_EVENT_DESC], [TRACE_EVENT_DETAILS], [CONNECTION_TYPE], [SQL_SESSION_ID], [AX_CONNECTION_ID], [IS_LOBS_INCLUDED], [IS_MORE_DATA_PENDING], [ROWS_AFFECTED], [ROW_SIZE], [ROWS_PER_FETCH], [IS_SELECTED_FOR_UPDATE], [IS_STARTED_WITHIN_TRANSACTION], [SQL_TYPE], [STATEMENT_ID], [STATEMENT_REUSE_COUNT], [DETAIL_TYPE], [STATS_TIME], [COMMENT]
FROM   [AX_SQLTRACE]
ORDER  BY [CREATED_DATETIME] DESC


—  HIDDEN_SCANS_QUERIES

— ————————————————————–
— Find Dynamics AX queries that only seek on DataAreaId
— NOT USEFUL for other products
—————————————————————–

SELECT TOP 100 *
FROM   HIDDEN_SCANS_CURR_VW
ORDER  BY TOTAL_ELAPSED_TIME DESC


—  OPTION_FAST_QUERIES

————————————————————————-
— Find queries option(fast) set that have sort operations
—  Dynamics AX only query

— Either we don’t have an index to match the order by clause
—  or the query is potentially to complex for SQL to pick that index
————————————————————————–

SELECT TOP 100 *
FROM   QUERY_STATS_CURR_VW
WHERE  SQL_TEXT LIKE ‘%OPTION(FAST%’
       AND QUERY_PLAN_TEXT LIKE ‘%PhysicalOp=”Sort”%’
ORDER  BY TOTAL_ELAPSED_TIME DESC


—  USER_SCANS_QUERY

— ————————————————————–
— Find Dynamics queries that are scanning
—————————————————————–

SELECT TOP 100 *
FROM   USER_SCANS_CURR_VW
ORDER  BY TOTAL_ELAPSED_TIME DESC

 

Get started with Dynamics 365

Drive more efficiency, reduce costs, and create a hyperconnected business that links people, data, and processes across your organization—enabling every team to quickly adapt and innovate.