speeding up queries

  • edit

  • Please post table definitions, index definitions and execution plan, as per http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

    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
  • I would create the index on all three columns DateOnly, Con, and TimeOnly, you could probably use the INCLUDE syntax and get a covering query that doesn't have to use the data pages at all. I assume this table has a lot more than 6 columns?

    CEWII

  • edit

  • edit

  • lcaruso (5/12/2010)


    It told me exactly what to do. Create a missing index. Impact > 93. :blush:

    Careful... Those are suggestions and not always the best index or even a good idea.

    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
  • edit

  • lcaruso (5/12/2010)


    ...and I was about to ask if the exec plan estimator was dumber than a DBA...

    Depends on the DBA...

    I'm calling from an external program in a loop for every day from 01-Jan-2010 to 30-Apr-2010

    since my sql skills are minimal, I don't know how to write that loop in sql directly so I can get the execution plan for that

    Why are you looping at all? SQL's strength is in set-based operations, operating on a whole lot of data at a time, not in looping through stuff.

    I'm still waiting for the table defs, index defs and exec plan to see what this is doing and what may be needed. Perhaps a bit of an explanation as to what this entire 'loop' is supposed to be achieving as well...

    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
  • edit

  • edit

  • edit

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

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