Heavy query with 2-Abort in profiler

Mkan1512
Member Posts: 2
Hi,
During a (re)search for a performance issue using the SQL Server Profiler we found (large) query's with an Error '2-Abort'.
Sometimes the reads are enormous (>200.000) and a duration of +73000
We see this query every time we open a sale/purchase order (or create a new) but not when we open a sale invoice (same table)
As a test, I removed almost all fields from page 42 (only No. and address info are still there) then we do not have the issue.
When I have only the No. field and "No. of Archived versions" (flowfield) we have the issue.
The start of the query is "SELECT TOP (50) ISNULL("Sales Header"."timestamp",0x0000000000000000) AS "timestamp",ISNULL("Sales Header"."Document Type",0) AS "Document Type",ISNULL("Sales Header"."No_",N'') AS "No_", ..."
It looks like that all the fields from table 36 are included.
Then there are several (7 for the sales order) OUTER APPLY (SELECT TOP(1) ... with an AS "SUB$No_ of Archived Versions" (for example)
Setup
The server (2012R2) is running on VMWare.
SQL (2012) & NAV (2013) are on the same server,
separate disk for Data/Log/TempDB
192Gb mem (174 for SQL)
Stats update every night
1. Error 2-Abort means that the client (not SQL) time-out. Why do we see this error (which time-out) ? How to fix
2. Is this query coming from the middle tier (I cannot find any code which is related) and is this normal behavior ?
During a (re)search for a performance issue using the SQL Server Profiler we found (large) query's with an Error '2-Abort'.
Sometimes the reads are enormous (>200.000) and a duration of +73000
We see this query every time we open a sale/purchase order (or create a new) but not when we open a sale invoice (same table)
As a test, I removed almost all fields from page 42 (only No. and address info are still there) then we do not have the issue.
When I have only the No. field and "No. of Archived versions" (flowfield) we have the issue.
The start of the query is "SELECT TOP (50) ISNULL("Sales Header"."timestamp",0x0000000000000000) AS "timestamp",ISNULL("Sales Header"."Document Type",0) AS "Document Type",ISNULL("Sales Header"."No_",N'') AS "No_", ..."
It looks like that all the fields from table 36 are included.
Then there are several (7 for the sales order) OUTER APPLY (SELECT TOP(1) ... with an AS "SUB$No_ of Archived Versions" (for example)
Setup
The server (2012R2) is running on VMWare.
SQL (2012) & NAV (2013) are on the same server,
separate disk for Data/Log/TempDB
192Gb mem (174 for SQL)
Stats update every night
1. Error 2-Abort means that the client (not SQL) time-out. Why do we see this error (which time-out) ? How to fix
2. Is this query coming from the middle tier (I cannot find any code which is related) and is this normal behavior ?
0
Comments
-
I would guess the query comes from a factbox. Finding the offender probably will help you figuring out, why it does not perform well.0
-
Thanks for answering, but no it is not coming from a factbox.
I have an page (as test) with only the No. field and "No. of Archived versions"0 -
"No. of Archived Versions" is a FlowField (right?) this also causes these OUTER APPLY statements.
There should be a "Disable Smart SQL" option in the NST settings. Try again with disabled Smart SQL.
Explaination: With SmartSql enabled the NST is trying to combine all FactBoxes and FlowFields in one single SQL Statement. So the NST is calling the SQL server only once instead calling it for each FlowField/FactBox.
But sometimes these queries are not so smart and the SQL server is not using the proper index and doing a table scan instead.
0 -
At first glance this really looks like an issue with Statistics, so I would focus on the nightly Statistics update and check that it is doing a FULL SCAN.David Singleton0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions