Please help me to improve this query performance

Praveen D'sa 2015-02-26 13:29:02

Hi,
This particular query takes more than 5 mins to execute, can you please help me to improve its performance.

HarryAir 2015-02-27 08:23:16
There is one sql in this batch that is taking 96.4% of the whole time. It is:

Select a.CustomerCode , A.CustomerNAme , CASE When B.PackageCode IS NULL Then 0 Else B.PackageCode End PackageCode,….

In that sql there is big data flow from NetworkVisitDetail table. Over 33 million rows.

Are you statistics up to date? Plan is showing estimated rows 1348375 but actual rows are 33090931.