CPU usage for SQL QUERY

  • hi all

    i am running same query with union and or condition.both are almost taking same time i mean in seconds.but i want to know the CPU usage of the both query. how to see the CPU usage of each query?

    thanks in advance:-P:-P:-P

    --------------------------------------------------------

    I am Learner -- SQL

  • A better (and easier!) idea might be to compare the execution plans for the two queries.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • SET Statistics Time On

    You can compare the exec plans, but do note that lower cost does not always mean faster query, the costs are estimates created at compile time.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • den how to etimate which one is best ?:-P

    --------------------------------------------------------

    I am Learner -- SQL

  • GilaMonster (4/21/2012)


    SET Statistics Time On

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • If you're comparing queries i'd be inclined to check i/o too...

    SET STATISTICS IO ON

    [font="Times New Roman"]There's no kill switch on awesome![/font]

Viewing 6 posts - 1 through 5 (of 5 total)

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