Status/Resolution/Reason: Closed/Withdrawn/CannotReproduce
Reporter/Name(from Bugbase): Yuliang R. / ()
Created: 06/28/2019
Versions: 2018
Failure Type: Performance Issue
Found In Build/Fixed In Build: 2018.0.04.314546 /
Priority/Frequency: Normal /
Locale/System: / Win 2016
Vote Count: 0
Problem Description:
on a very specific query with specific data input, the query returns very very slow. with slightly different but equivalent sql statement, the query returns instant.
Steps to Reproduce:
notes (Datasource=db2, Time=39320ms, Records=20) in @ 08:05:54.054
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT TOP 20 id,productId,itemID,createdOn,message,createdBy,comments,manual,logType,qty,dataid,qtyOnHandAdj
FROM inventoryLog WHERE itemid = ?
AND logType <> 9
ORDER BY createdOn Desc
Query Parameter Value(s) -
Parameter #1(CF_SQL_INTEGER) = 40483
i played around with the TOP N. ONLY TOP 20 takes long. TOP 19,21,25,50 whatever all take milliseconds
i played around with column list.
if i exclude the dataID column, it's instant.
if i alias dataID as something, it's instant.
if i alias dataID as dataID, it's instant.
so it's only bad when TOP 20 and dataID without alias and itemID. some other itemID's work instant. some other itemID's are slow like this.
it doesn't make sense.
Actual Result:
super slow query depending on inputs
Expected Result:
<50ms
Any Workarounds:
Attachments:
Comments: