-
Type: Feature Request
-
Status: Closed (View Workflow)
-
Priority: Critical
-
Resolution: Completed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:
This query was determined to be using 30% of the CPU resources on the SQL server during non-EOM timeframes:
exec sp_executesql N'SELECT this_.SalesItemMetricDetailId as SalesIte1_121_0_, this_.SalesItemId as SalesIte2_121_0_, this_.IntervalStart as Interval3_121_0_, this_.LastYearTransactionCount as LastYear4_121_0_, this_.ManagerTransactionCount as ManagerT5_121_0_, this_.RawTransactionCount as RawTrans6_121_0_, this_.SystemTransactionCount as SystemTr7_121_0_, this_.ServiceType as ServiceT8_121_0_, this_.MgrDetailsChanged as MgrDetai9_121_0_, this_.ForecastId as ForecastId121_0_ FROM Forecasting.SalesItemMetricDetail this_ WHERE ((this_.ForecastId = @p0 and this_.IntervalStart >= @p1) and this_.IntervalStart < @p2)',N'@p0 bigint,@p1 datetime,@p2 datetime',@p0=6130758,@p1='2020-05-30 00:00:00',@p2='2020-05-31 00:00:00'
Suggestions from SQL optimization consultant:
- Create a new Non Clustered index on columns (ForecastID, IntervalStart) similar to the index on Forecasting.InventoryItemMetricDetail table. As seen by Missing Index hint from execution plan above, adding this index will improve performance by 98%
- Currently there is an index on ForecastID column. We need to analyse the code to see if there are times we search Forecasting.SalesItemMetricDetail only using the “ForecastID” column. Looking at the usage, it seems that we always search this table by “ForecastID” and “IntervalStart” columns. In this case we can delete the index : “IX_SalesItemMetricDetail_forecastId”, or convert this to add “IntervalStart” column as well as mentioned above.
- is implemented by
-
CFAMX-10245 Augment/Create Load Tests
- Open
-
CFAMX-10246 Documentation
- Open
1.
|
Create/Test Index | Done | Corey Amend (Inactive) |
|