Why such poor performance from same query in different databases

PCF927 2018-07-15 13:18:22

This query took over 10 hours to run on one database, but only 15 seconds on another with identical schemas. I've refreshed all stats and rebuilt all indexes but can't get this to improve.
Any suggestions

Hugo Kornelis 2018-07-17 09:14:24
There are currently some issues with this website. Due to these, your uploaded .pesession file cannot be downloaded. I suggest finding another way to share the plan details. Options include:

  1. Use a file sharing website, upload the .pesession file there (making sure to set access rights to public), then post a link here; or
  2. Upload the execution plans to www.pastetheplan.com, which presents the plans in a way that is easier to digest, but you can only upload the execution plan and not the .pesession file (which usually contains additional information).

Whichever option you choose, do make sure to share both the slow and the fast version of the execution plan, and to clearly indicate which is which. If available, please post output of set statistics io / time as well.

Oh, and just to make sure: when the slow query was running, did you check for locking and blocking?