|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 1:15 AM
Points: 36,
Visits: 254
|
|
Hi All,
I have replaced 3 temp tables in my batch with multiple CTEs. I see remarkable 50% benefit in REads and Writes have reduced to 0, however, I wanted to know on the CPU. Is CTE CPU Intensive? I am getting varying CPU results.
Also, I see from other questions that CTEs hit performance when table size is v great. Is that so?
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Yesterday @ 7:36 PM
Points: 32,931,
Visits: 26,820
|
|
nidhis (12/13/2012) Hi All,
I have replaced 3 temp tables in my batch with multiple CTEs. I see remarkable 50% benefit in REads and Writes have reduced to 0, however, I wanted to know on the CPU. Is CTE CPU Intensive? I am getting varying CPU results.
Also, I see from other questions that CTEs hit performance when table size is v great. Is that so?
"It Depends" on what the Temp Tables are being used for and how they are being used. Just like views and derived tables, CTEs can be quite good at performance and quite bad.
--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."
For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
|
|
|
|