don't understand Index Analysis

Meenak 2017-06-09 02:25:40

Meenak 2017-06-09 02:28:09
how to optimize below query?
SELECT top 1000 1 AS [C1], [Filter1].[STD1] AS [STD], [Filter1].[CarrierCode1] AS [CarrierCode], [Filter1].[DeparturePort] AS [DeparturePort], [Filter1].[FlightNumber1] AS [FlightNumber], CASE WHEN ([Filter1].[HasReturnFlight] IS NULL) THEN cast(0 as bit) ELSE [Filter1].[HasReturnFlight] END AS [C2], [Filter1].[BagNumber] AS [BagNumber], [Filter1].[KioskTransactionPassengerID1] AS [KioskTransactionPassengerID], [Extent6].[SBDTransactionID] AS [SBDTransactionID], [Extent6].[SBDTransactionPassengerID] AS [SBDTransactionPassengerID], [Extent6].[SBDTransactionBagsID] AS [SBDTransactionBagsID] FROM ( SELECT [Extent1].[CarrierCode] AS [CarrierCode1], [Extent1].[FlightNumber] AS [FlightNumber1], [Extent1].[STD] AS [STD1], [Extent1].[DeparturePort] AS [DeparturePort], [Extent2].[CarrierCode] AS [CarrierCode2], [Extent2].[PortCode] AS [PortCode], [Extent2].[HasReturnFlight] AS [HasReturnFlight], [Extent3].[KioskTransactionPassengerID] AS [KioskTransactionPassengerID1], [Extent4].[BagNumber] AS [BagNumber], [Extent5].[SBDTransactionID] AS [SBDTransactionID] FROM [dbo].[KioskTransactionFlights] AS [Extent1] INNER JOIN [dbo].[KioskTransactions] AS [Extent2] ON [Extent1].[KioskTransactionID] = [Extent2].[KioskTransactionID] INNER JOIN [dbo].[KioskTransactionsPassengers] AS [Extent3] ON [Extent1].[KioskTransactionID] = [Extent3].[KioskTransactionID] INNER JOIN [dbo].[KioskTransactionBags] AS [Extent4] ON [Extent3].[KioskTransactionPassengerID] = [Extent4].[KioskTransactionPassengerID] LEFT OUTER JOIN [dbo].[SBDTransactionFlights] AS [Extent5] ON ([Extent1].[STD] = [Extent5].[STD]) AND ([Extent1].[CarrierCode] = [Extent5].[CarrierCode]) AND ([Extent1].[FlightNumber] = [Extent5].[FlightNumber]) AND ([Extent1].[DeparturePort] = [Extent5].[DeparturePortCode]) WHERE NOT ((N'Failure' = [Extent2].[TransactionResult]) AND ([Extent2].[TransactionResult] IS NOT NULL)) AND ([Extent1].[STD] >= '2017-05-28 00:00:00') AND ([Extent1].[STD] <= '2017-05-29 00:00:00') ) AS [Filter1] LEFT OUTER JOIN [dbo].[SBDTransactionBags] AS [Extent6] ON [Filter1].[SBDTransactionID] = [Extent6].[SBDTransactionID] WHERE (([Filter1].[CarrierCode2] = 'JQ') OR (([Filter1].[CarrierCode2] IS NULL) AND ('JQ' IS NULL)) OR ('JQ' IS NULL) OR (( CAST(LEN('JQ') AS int)) = 0)) AND (([Filter1].[PortCode] = '') OR (([Filter1].[PortCode] IS NULL) AND ('' IS NULL)) OR ('' IS NULL) OR (( CAST(LEN('') AS int)) = 0)) AND ([Extent6].[Delivered] = 1 OR [Extent6].[Delivered] IS NULL)