SQL Server 2008 Express - Very slow SQL execution

Last post 09-08-2008 6:45 AM by kfk. 2 replies.
Page 1 of 1 (3 items)
Active Topics My Discussions Unanswered Sort Posts: Previous Next
  • 09-08-2008 4:10 AM

    • kfk
    • Not Ranked
    • Joined on 09-08-2008
    • Posts 5

    SQL Server 2008 Express - Very slow SQL execution

     Recently, when I heard SQL Server 2008 had been released I naturally got curious about it, since 2005 was a major improvement over 2000, so I decided to install it.

    After about 3 hours of hell, over 10 reboots, installing several dependencies (which IMO should have been part of the installation, or at least downloaded and installed automatically during it) and figuring out why the "Performance Counter" check was failing even after manually rebuilding the performance counter several times (turns out the setup was checking the wrong registry key, and not the same one the OS was using - who would have thought...) , I finally managed to get it installed.

     Now, I have another problem.

    Executing SQL queries seems to be incredibly slow compared to SQL Server Express 2005, which I still have installed alongside 2008.

     After running the SQL Profiler on both instances, I notice that the same query, run by the exact same program on the 2 instances result in a different event.

    On the 2005 instance, it says "RPC:Completed" with the text "exec sp_executesql N' <sql code goes here>", while on the 2008 one it says "SQL:StmtRecompile" and simply contains the SQL code as its text.

    Basically, when running a very simple SQL ("select * from <table>") on both of the instances, the SQL server 2005 always returns the recordset instantly (00:00:00 on time), while the 2008 instance always takes 2-3 seconds to return the recordset (this is from the same table on both instances, with approximately the same content - 3-4 records less on the 2008 instance actually).

     Does anyone know what could be causing this? Is there any way to fix it?

  • 09-08-2008 4:15 AM In reply to

    • satya
    • Top 10 Contributor
    • Joined on 11-05-2002
    • United Kingdom
    • Posts 22,515
    • Microsoft MVP
      Moderator

    Re: SQL Server 2008 Express - Very slow SQL execution

    Welcome to the forums.

    What kind of statistics you have collected on this SQL 2008 instance to say it is running slow on CPU or MEMORY or physical disk.

    Have you performed reindex of indexes on the database once it is restore?

    -Satya S K J

    SQL Server MVP



    Knowledge is Power, you will gain by sharing it. SSQA.net - Invisible contributions to the users & visible success in SQL Community.
  • 09-08-2008 6:45 AM In reply to

    • kfk
    • Not Ranked
    • Joined on 09-08-2008
    • Posts 5

    Re: SQL Server 2008 Express - Very slow SQL execution

     Thanks for the reply.

     After I ran one of our programs on the instance, it ran through a process simply labeled as "Optimizing database performance". As I didn't write (nor have I seen) the particular piece of code behind this "optimization", I don't know exactly what it did, but I think it at least disabled the AutoClose db option on the databases.

     In any case, after the "optimization", SQLs are now executing at normal speed (instantly) on the 2008 instance as well, and even when installing a new SQL server 2008 instance without "optimizing" the databases, I can't reproduce the slowness anymore, so presumably it has also set some global options in addition to the instance and database specific ones.

    The exact cause remains a mystery, but the problem seems to be solved. Big Smile

     As for statistics, I hadn't really checked any statistics, but it seemed logical that since both SQL servers are running on the same computer, at the same time, they should both be able to execute SQLs at the same speed, if not even faster in the new version.

Page 1 of 1 (3 items)
Active Topics   My Discussions    Unanswered Posts


© 2000 - 2007 vDerivatives Limited All Rights Reserved.