We are noticing below SQL is causing very High CPU and its been executed 10,000 times. Is there a way we can tune this T-sql?
SELECT ISNULL(max(trans_seq),0) +1 FROM inv_inventory_journal WHERE organization_id = @P0 AND wkstn_id = '600'
From Execution Plan, it is suggesting to create the following index.
/* Missing Index Details from ExecutionPlan1.sqlplan The Query Processor estimates that implementing the following index could improve the query cost by 98.8039%. */ /* USE [LKY_Xcenter] GO CREATE NONCLUSTERED INDEX [<Name of Missing Index, sysname,>] ON [dbo].[inv_inventory_journal] ([organization_id],[wkstn_id]) INCLUDE ([trans_seq]) GO */