SQL server 2005 query timeout on production only

  • I have a strange issue in the production server.

    An sql select query for generating reports causes 100% CPU and timeouts only if the Start date is equal to or above 2nd March 2012.

    Whereas all the reports can be generated perfectly if the start date is less than 2nd March.

    Also this issue is faced in the production server only. I had taken a dump of database and restored the whole environment and was able to generate all reports with any date range.

  • http://sqlinthewild.co.za/index.php/2011/03/22/statistics-row-estimations-and-the-ascending-date-column/

    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
  • Hi GilaMonster,

    The link says to do a scheduled statistics update, did not get that m kinda new to sql could you pls explain how to do that.

    And I've tried and failed to generate the reports on production server on 14th June 2012 with start date 2nd March & end date 14th June.

    Also how is the same working on any local server.

    Regards,

    Rohit

  • Look up UPDATE STATISTICS in Books Online.

    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
  • Hi GilaMonster,

    Updating the statistics solved the issue.

    Thanks

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

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