Forum Discussion

anoopdba's avatar
anoopdba
Copper Contributor
Apr 28, 2023

Cardinality Estimator understading

I have a query that i am running from the query analyser, there are no trace flags enabled in it. When do properties of the select in the query plan I see following

My database is at compatibility lever 150, so why i am seeing this? Is it normal ?

  • LainRobertson's avatar
    LainRobertson
    Silver Contributor

    anoopdba 

     

    The cardinality estimation version can vary, and a lower value doesn't automatically imply something is wrong.

     

    Read the following article thoroughly as it covers:

     

    • Some of the scenarios where the cardinality estimation can run into issues (probably the most useful part to read);
    • How to monitor cardinality and make sense of the results;
    • How to force cardinality (where appropriate to do so.)

     

     

    Cheers,

    Lain

    • anoopdba's avatar
      anoopdba
      Copper Contributor

      LainRobertson Thanks for your help. I have gone through the article.

      The query i am looking at is performing poorly and i am not sure why it is using an old cardinality estimator even though my database is at latest CE.

      • LainRobertson's avatar
        LainRobertson
        Silver Contributor

        anoopdba 

         

        The article outlines multiple reasons in the second bullet point list near the top of the article.

         

        Cheers,

        Lain

Resources