Job running too long due to HWM issues on associated tables
Hello there,
We have a Job that runs heavy inserts, updates and deletes on tables in the database, few of the tables are used as application temp tables as well. The issue is that during the job for any one of the statement, the optimizer will pick up bad plan (due to Cardinality misestimate) and will hang/keep running for hours. We tried gathering stats on all the associated tables just before the job, but still it didn't help. A good run for this job is 2 hours but when issue arises it runs for more than 8 hours (we kill and apply