Home Forums SQL Server 2012 SQL 2012 - General Adding Windows Function causes very bad performance (help plz!) RE: Adding Windows Function causes very bad performance (help plz!)

  • Thanks gentlemen I'm still tuning this query but I got it from 7 hours to a couple minutes now which is acceptable. I started doing the temp table idea by Erik but as I kept checking the execution plans and focusing in on the scans and the RID lookups and Table Scans Allan mentioned I was able to get indexing in place that seemed to get 5.6 million rows processed in a decent time or at least for my needs. Attached is the updated execution plan.

    One other thing I noticed was on one of my joins before on one key it was VARCHAR(50) and on the other side it was NVARCHAR(50) I made both VARCHAR(50) and no longer received a warning. I do however still have a warning on the my age calculations for Cardinality estimates and I'm wondering if it is really effecting my query ?

    I'm on Amazon looking at Query Tuning books. I currently have Grants SQL Server Execution plans open on the desk and about 2/3 rds through it.

    Thanks !

    ***SQL born on date Spring 2013:-)