sql server - Need help understanding and improving query plan (Estimated Number of Rows is very different from Actual Number of Rows) -
i'd understand section of query plan seems mess query.

the picture shows there's clustered index seek, followed compute scalar, followed sort. part not understand, if compute scalar's estimated rows 327,561, why sort's estimated number of rows 14? assume compute scalar return 14 results though it's input estimated @ 327,561 rows?
i tried running update statistics on register_hdrs table 'with sample 100 percent', didn't seem change behavior @ all. suggested indexes improve performance of 'clustered index seek', sort still estimates number of rows @ 14, , query plan remains same. need pick different path, there's table in query when picked speeds query 14 times (it goes running in 14-15 seconds 1 second). believe under-estimate on number of rows in sort problem, , why slow plan gets picked.
i'm not looking change query, because application generates in specific way, , wouldn't possible change @ point. i'm looking how force sql server give better estimate rows in sort, believe result in sql server picking different execution plan.
Comments
Post a Comment