Measuring the cpu and ram consumption of a given query in sql server

hello there how you doing and am new to this sql server forum and i suddenly popped to ask questions related to sql server
and my question goes like this
in sql server i have table called testt and it have more thna10000000 records
and i have written a query select * from testt limit 9000000; and what i want is to measure the
CPU consumption of this given query=???????????????
and
RAM consumption of this given query=???????????????
Time consumption of this given query=?????????????? this i will get it from the result bar but i don't know whether it is correct or not
any help on this it may be query, tool or configurations all are acceptable and appreciated
10Q for letting me ask questions and feeling freely.

Please check these queries and this may helps you to get whats happening on with CPU currently..
SELECT getdate() as "RunTime", st.text, qp.query_plan, a.* FROM sys.dm_exec_requests a CROSS APPLY sys.dm_exec_sql_text(a.sql_handle) as st CROSS APPLY sys.dm_exec_query_plan(a.plan_handle) as qp order by CPU_time desc
Top 50 CPU usage :
SELECT TOP 50 st.text
               ,st.dbid
               ,st.objectid
               ,qs.total_worker_time
               ,qs.last_worker_time
               ,qp.query_plan
FROM sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) qp
ORDER BY qs.total_worker_time DESC
SP_Whoisactive --- download from : http://www.brentozar.com/responder/log-sp_whoisactive-to-a-table/
Activity Monitor and sp_who2 active also will give some idea...
Reference links...
http://channel9.msdn.com/posts/SQL-server-High-CPU--Part-1
http://channel9.msdn.com/posts/Troubleshooting-SQL-server-High-CPU--Part-2
http://jeffstevenson.karamazovgroup.com/2008/09/identifying-high-cpu-sql-processes.html
http://searchsqlserver.techtarget.com/tutorial/Step-1-CPU-usage
================
Execute this script and and start doing your analysis in your server so that you will get more idea how its working and all the details...
Sample CPU Test : Dont try this in production and try this in your test or Dev server..
-- Query to Keep CPU Busy for 2 0 Seconds
DECLARE    @T DATETIME, @F BIGINT;
SET @T = GETDATE();
WHILE DATEADD(SECOND,20,@T)>GETDATE()
SET    @F=POWER(2,30);
You can easily change the parameter in the DATEADD and can make it run for 50 seconds.
-- Query to Keep CPU Busy for 50 Seconds
DECLARE    @T DATETIME, @F BIGINT;
SET @T = GETDATE();
WHILE DATEADD(SECOND,50,@T)>GETDATE()
SET    @F=POWER(2,30);
Raju Rasagounder MSSQL DBA

Similar Messages

  • CPU and RAM size for database

    How can we see what is the CPU and RAM size for the database?
    <div class="jive-quote">select * from v$version</div>
    BANNER                                                          
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production                          
    CORE     10.2.0.5.0     Production                                        
    TNS for HPUX: Version 10.2.0.5.0 - Production                   
    NLSRTL Version 10.2.0.5.0 - Production

    cat /proc/meminfo
    root:     total:      used:      free:           shared:     buffers:     cached:
    Mem:      1055760384     1041887232     13873152     0     100417536      711233536
    Swap:      1077501952      8540160      1068961792
    MemTotal:          1031016 kB     
    MemFree:          13548 kB
    MemShared:          0 kB
    Buffers:          98064 kB
    Cached:               692320 kB
    SwapCached:          2244 kB
    Active:               563112 kB
    Inact_dirty:          309584 kB
    Inact_clean:          79508 kB
    Inact_target:          190440 kB
    HighTotal:          130992 kB
    HighFree:          1876 kB
    LowTotal:          900024 kB
    LowFree:          11672 kB
    SwapTotal:          1052248 kB
    SwapFree:          1043908 kB
    Committed_AS:          332340 kB
    cat /proc/cpuinfo
    processor : 0
    vendor_id : AuthenticAMD
    cpu family : 15
    model : 31
    model name : AMD Athlon(tm) 64 Processor 3000+
    stepping : 0
    cpu MHz : 994.927
    cache size : 512 KB
    fpu : yes
    fpu_exception : yes
    cpuid level : 1
    wp : yes
    flags : fpu vme de pse tsc msr pae mce (snipped)
    bogomips : 1956.97
    TLB size : 1024 4K pages
    clflush size : 64
    cache_alignment : 64
    address sizes : 40 bits physical, 48 bits virtual
    power management: ts fid vid ttp

  • Different output of same query in SQL Server and Oracle

    I have two tables table1 and table2
    --table1 has two columns c1 int and c2 varchar. there are not constraints added in it. it has data as given below
    c1     c2
    6     d
    5     j
    102     g
    4     g
    103     f
    3     h
    501     j
    1     g
    601     n
    2     m
    --table2 has only one column c1 int. there are not constraints added in it. it has data as given below
    c1
    6
    1
    4
    3
    2
    now when i run below given query in sql server and oracle it gives me different result
    select *
    from table1
         inner join (SELECT ROW_NUMBER() OVER (order by c1 ASC) AS c1 from table2) table2 on table2.c1=table1.c1
    sql server output
    c1     c2     c1
    1     g     1
    2     m     2
    3     h     3
    4     g     4
    5     j     5
    oracle output
    C1 C2 C1
    5 j 5
    4 g 4
    3 h 3
    1 g 1
    2 m 2
    If you notice the first column in both output. It is sorted in sql server and not in oracle.
    Why it is behaving differently in oracle? Is there any way I can solve this in oracle?
    Thanks,
    Jigs

    It is NOT behaving "differently" in Oracle; you just haven't specified an order that you expect your results to be in, so you're going to get output in whatever order the database fancies displaying it (ie. no guarenteed order). This is an artifact of how the database chooses to put together the data, and different databases (or even datasets within the same database) can and most likely will behave differently.
    Even SQL Server won't guarentee to always get your data in an ordered fashion if you exclude the order by clause, even if you think it has always output the data in an ordered fashion.
    Your solution is to add an order by clause, in BOTH databases, to force the order of the output data.

  • MOVED: getting most ffrom my cpu and ram cinfigd in the bios

    This topic has been moved to Overclockers & Modding Corner.
    getting most ffrom my cpu and ram cinfigd in the bios

    You can use CPU-Z to check your settings.  I find it best to just use good ole bios overclocking.  Set ram 1:1(FSB/Dram ratio) and FSB to 200 that that should give you 2200Mhz.

  • Where to see CPU and RAM usage in IPAD 1

    Hi:-)
    While i have Apps running , I would like to be able to see CPU and RAM in use..and ideas how/where?
    Thanks

    There are several apps in the app store that can show you cpu and ram usage of your device, e.g. "system info"

  • How do I measure the CPU/GPU split of load/usage in Java3D?

    Hello,
    Is it possible to measure the split between graphics and CPU usage to find out how much work each is doing, what work is done, and which is doing the most work, for example? If so, how can this be implemented in the Java3D code?
    For example, on a particular system, measure whether the GPU is doing the most work, or the CPU.
    Thanks for your help :)

    In Linux, you can read /proc/uptime. It does NOT give you the load averages that the command uptime gives. It gives you numerically the amount of time the CPU was idle vs how much time it was spent doing something. You need to read these two floating point numbers one every second, or once every 5 or 10 seconds then do the delta on the change: The maths are as follows:
    Read the file in twice in 5 seconds, parse into two floats/doubles:
    double[] last;  // the first read of the file
    double[] rect;  // the latest read of the file
    double ld = last[1] - last[0];
    double rd = rect[1] - rect[0];
    double cpu = (1.0d-(rd/ld)) * 100.0d;This should print the CPU percentage in Linux for that given time frame (5 second updates).

  • HELP: Premiere Pro CC not using all CPU and RAM during rendering and export

    Hello,
    I am using Premiere Pro CC on a Windows 7. My timeline is quite simple with two videos, one with the movie (mpeg) and the other with the subtitles (avi).
    When I render the sequence in PP or export, the rendering time is way too slow and it only uses around 15-20% of the CPU and 3 GB of RAM.
    My hardware config is :
    - CPU : i7-4770k 3.50Ghz
    - RAM : 8 GB
    - Disk : 2 x 3 TB SATA (no raid)
    RAM is not the bottleneck, neither the disk access.
    I have tried rendering and exporting the same project on an iMac (with an i5 2.7 Ghz and 4 GB RAM and only 1 disk) and the result is 4x faster !!!
    The CPU usage is close to 100% as well as RAM usage.
    So how come PP uses all resources availble on an iMac and not on a Windows 7 ?
    Is there any known bug or software bottleneck on Windows 7 ?
    My machine is brand new and nothing much installed besides Adobe products.
    Any help is very much appreciated.
    Thanks,

    I just rendered out a a 2 minute sequence with about 100 clips in it and Colorista effects on everything to the Vimeo 1080 H264 preset. It took about 5 minutes to render straight from Premiere, it used all the recourses it could, my CPU was running at near %100, same with my ram and GPU, I was happy.
    Then I did another render with Red Giant Denoiser and it now wants to take 30 mins and it is only using about %20 of the recourses available. My problem isn't that its taking longer with Denoiser but that its not using all of my computers CPU and GPU.
    Im rendering at maximum render quality and bit dept to H264 (Im happy to wait the extra time), if I try to use VRB 2 it encodes 1 pass at a time and wants to take up to 40 minutes.
    I would appreciate some advice on this.
    Premiere Pro CC 2013
    2.6 GHz Intel Core i7
    NVIDIA GeForce GT 750M 2048 MB (CUDA GPU enabled in Premiere)
    16 GB 1600 MHz DDR3
    OS X 10.9.4 (13E28)

  • Z77A-gd65A boot error code 15 rebthing i removed all except cpu and ram and oot

    my pc used to work fine yesterday i shut it down and started it today and it kept cycling rebooting at code 15 on debug i changed to bios B and the same thing did clear cmos both ways even removed  the battery the same also removed all except cpu and ram but still the same result please help !

      I have no idea how you possibly could corrupt bios A if you weren't running Live Update or manually attempted to flash. if bios is really corrupted follow: >>Flashing a Corrupted bios when the alternate bios still works<<

  • Firefox does not open when clicking on the icon, the firefox.exe process consumes 99 % of the CPU and my computer runs slowly.

    I have been a happy user of Firefox for many years. Around last April first I opened Firefox and was offered an update to v 4.42.0.0 which I accepted. Installation seemingly went well. I forget now exactly what happened but the result has been that ever since April 1 I haven’t been able to open the Firefox browser when clicking on the Firefox icon. My computer now was running very slowly. I tried to uninstall Firefox, but a popup told me I couldn’t because Firefox was in use. This confused me because I couldn’t see it being used. Only now I have found that on Task Manager processes that “firefox.exe” was consuming 99 % of the CPU. After removing firefox.exe by clicking End Process my computer ran better. I uninstalled Firefox I had on my computer and installed Firefox 5.0. Unfortunately I have the same problems: Firefox does not open when clicking on the icon, the firefox.exe process consumes 99 % of the CPU and my computer runs slowly.

    Born2die! Brilliant. I am a desktop clicker and never knew Firefox had a safe mode.
    Thank You!
    I was unable to start in safe mode initially. The second time I disabled all of the Add-Ons and she started up just fine. I enabled them one by one hoping to track down the culprit but the problem seems to have gone away.
    BTW I am running ver. 3.6.8 (in response to cor-el's earlier post) and
    Firefox is in the process of downloading 3.6.10 (which I am starting to think may have been what caused this whole problem to begin with)
    Incidentally, whats up with all of the Java Console Add Ons?
    I have:
    Java Console 6.0.11, Java Console 6.0.13, Java Console 6.0.15
    Java Console 6.0.17, Java Console 6.0.20, and Java Console 6.0.21
    What are they? Do I need them? Can I uninstall them? Is this due to using Open Office?
    Also, .NET Framework 0.0.0 Should I uninstall it?

  • Is there any Vi for getting the CPU and Memory usage of the Local as well as Remote System

    Is there any Vi for getting the CPU and Memory usage of the Local as well as Remote System

    Find the attachment(LV8.5) for local machines. 
    You can use shared variables to monitor the remote machine's usage.
    Attachments:
    Task Monitor 85.vi ‏25 KB

  • I have an air with 64Gb hard drive and 2Gb RAM and would like to upgrade both the HD and RAM. WHat should I buy?

    I have an air with 64Gb hard drive and 2Gb RAM and would like to upgrade both the HD and RAM. WHat should I buy?

    TWTexas wrote:
    WHat should I buy?
    compensate or purchase a new Air
    Recommend a SUPERSLIM portable 1TB HD
    RAM cant be upgraded, as The Fox-man has already said.

  • What temperatures are acceptable for the CPU and Graphics card?

    I have Intel Xeon X5400 series CPUs and a Nvidia graphics card.  
    It is interesting to monitor the temperatures but only if you know what temps matter...
    What temperatures are acceptable for the CPU and Graphics card? 
    I was not sure if this is the document of choice for the CPU or not. I was not sure I was decifering it correctly either. 
    http://download.intel.com/design/xeon/datashts/318589.pdf
    Any one know what we should be watching for as far as what is too hot? 
    I have a ThinkStation D10.
    Did not see this in the user manual but could have missed it. 

    I found my specs:
    Intel(R) Xeon(R) CPU           E5405  @ 2.00GHz
    You are correct. An E series. 
    I was so focused on the upgrade to the X5420 that I forgot what the system came with. 
    So what should I set my sensor high value to on my sensor program that shows up on the panel (taskbar)?
    For the E5405 or the X5420? 
    SIDE NOTE: where can I get 2 E5420s or better cheap? 
    Not ready to give up my filters just yet. I live in a dust factory! 
    My girl friend sews really nice bags but creates sewing dust and fuzz. 
    And well there are natural fibers everywhere...
    So other than the the X5492 (150watts),  the X5482, X5472,  X5470, X5460, X5450 are all 120 watts.
    Like the bulk of the X series...
    The E5405, E5410, E5450, E5440, E5420, E5430, E5470, E5462, E5472 are all 80 watts.
    The L series seems to all be 50 Watts.  
     For many the other Processors see this:
    http://www.intel.com/products/processor/xeon5000/specifications.htm?iid=products_xeon5000+tab_specs
    Message Edited by VitalBodies on 12-06-2008 08:46 PM
    Message Edited by VitalBodies on 12-06-2008 09:03 PM

  • Error 18452 "Login failed. The login is from an untrusted domain and cannot be used with Windows authentication" on SQL Server 2008 R2 Enterprise Edition 64-bit SP2 clustered instance

    Hi there,
    I have a Windows 2008 R2 Enterprise x64 SP2 cluster which has 2 SQL Server 2008 R2 Enterprise Edition x64 SP2
    instances.
    A domain account "Domain\Login" is administrator on both physcial nodes and "sysadmin" on both SQL Server instances.
    Currently both instances are running on same node.
    While logging on to SQL Server instance 2 thru "Domain\Login" using "IP2,port2", I get error 18452 "Login failed. The login is from an untrusted domain and cannot be used with Windows authentication". This happened in the past
    as well but issue resolved post insatllation of SQL Server 2008R2 SP2. This has re-occurred now. But it connects using 'SQLVirtual2\Instance2' without issue.
    Same login with same rights is able to access Instance 1 on both 'SQLVirtual1\Instance1' and "IP1,port1" without any issue.
    Please help resolve the issue.
    Thanks,
    AY

    Hello,
    I Confirm that I encountred the same problem when the first domain controller was dow !!
    During a restarting of the first domain controller, i tried to failover my SQL Server instance to a second node, after that I will be able to authenticate SQL Server Login but Windows Login returns Error 18452 !
    When the firts DC restart finishied restarting every thing was Ok !
    The Question here : Why the cluster instance does'nt used the second DC ???
    Best Regards     
    J.K

  • Automate the database and forms / reports services to start on windows 2008 server R2 startup

    Dear memebers,
    I want to automate the database and forms / reports services to start on windows 2008 server R2 startup. whats the possibilities and which method is the best?
    Regards:

    Hi,
    type services.msc at run
    then check for Oracle Services--> Right Click-->Properties-->Startup type-->start automatic
    HTH

  • How to find out the plants and storage location for a given company code

    hi
    How to find out the plants and storage location for a given company code

    Hi
    Check for Assignem,ent of Plant & compnay code in OX18
    & for Combination of Plant & Storage location in OX09
    The total org structure can be viewed in EC01 - Click on Structure  -> navigation
    & Continue, Click on the Compnay code & the wole structure can be viewed
    Thanks & Regards
    Kishore

Maybe you are looking for