which operations will use more CPU resource?

  • in SQL Server, which operations will use more CPU resource? it seems that compilation and recompilation will lead to high CPU workload. are there any other operation will cause cpu high workload. thanks !

  • Every single query is using some CPU. Depending on what the queries are doing, sorts, etc., more CPU is necessary to figure things out. Parallelism causes CPU because a given query uses more. Data compression. Encryption. Bad or missing indexes. Missing or out of date statistics. Bad code. All this contributes to CPU use. It's not just about compiles & recompiles.

    ----------------------------------------------------
    The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
    Theodore Roosevelt

    The Scary DBA
    Author of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd Edition
    Product Evangelist for Red Gate Software

  • 892717952 wrote:

    in SQL Server, which operations will use more CPU resource? it seems that compilation and recompilation will lead to high CPU workload. are there any other operation will cause cpu high workload. thanks !

    You need to measure your system.  Compilation and Recompilation can actually be a God-send in some cases and absolute the worst thing that can happen in other cases.    The same holds true for CPU workload.   For example, does parallelism help or hurt during the given workload?  There is no rule of thumb here.  "It Depends" and you "Must Look Eye".

     

    --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.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

  • Jeff Moden wrote:

    892717952 wrote:

    in SQL Server, which operations will use more CPU resource? it seems that compilation and recompilation will lead to high CPU workload. are there any other operation will cause cpu high workload. thanks !

    You need to measure your system.  Compilation and Recompilation can actually be a God-send in some cases and absolute the worst thing that can happen in other cases.    The same holds true for CPU workload.   For example, does parallelism help or hurt during the given workload?  There is no rule of thumb here.  "It Depends" and you "Must Look Eye".

    Thank you for your good  idea!

Viewing 4 posts - 1 through 4 (of 4 total)

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