Odd behavior -- execution plan different when I execute in the target database vs not in the target database

  • llevity - Tuesday, May 8, 2018 1:07 PM

    Yep, bingo, the databases are at different compatibility level. Good call on that Sue, and thanks for the help and verification, Grant.  Now to read on about cardinality estimators in the different compatibility levels.  It works better in the older comp version, unfortunately, so my next step is to experiment with the different solution approaches.

    Thanks all!

    Well, the immediate fix is to force the old cost estimator: 

    OPTION (QUERYTRACEON 9481) --2312 will force new cost estimator

    The longer-term solution is likely more complex than that. :hehe:

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

Viewing post 16 (of 15 total)

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