get rid of key lookup

  • trying to help 3rd party app (can't fix tsql) with an index big tie up on key lookups, made covering index still won't use it

     

    keylookup

  • What's your question?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • To be honest, can't tell much from the picture of the execution plan.  Even though you can't fix the T-SQL (the best way to fix if possible), actually seeing the code would be quite helpful as well.  So would seeing the DDL for the tables and the indexes on the tables.

     

  • What's the query and what indexes do you have on the table? and how on Earth do you expect people to make out a tiny screen dump of an execution plan?

  • sorry image did not come across as planned, I missed an obvious on the key lookup that actual rows millions of rows more than estimated.  The even uglier part of this is this 3rd party reporting tool they are using goes against the RO node of an AG.  So not only is not changing sql an option but adding and index on the OLTP side may have a negative effect.    this is a massive EMR database with over 9k users may try to measure how out of sort index/stats are (run ola's index maint plan every sunday)

  • tcroninlifepoint wrote:

    sorry image did not come across as planned, I missed an obvious on the key lookup that actual rows millions of rows more than estimated.  The even uglier part of this is this 3rd party reporting tool they are using goes against the RO node of an AG.  So not only is not changing sql an option but adding and index on the OLTP side may have a negative effect.    this is a massive EMR database with over 9k users may try to measure how out of sort index/stats are (run ola's index maint plan every sunday)

    I guess I'd start beating on the 3rd party to fix their junk.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply