select query is getting slow

  • vivekvinodhraj (6/22/2011)


    hi, please let me know if you need any other details regards this issue

    I can't even open the trace file (pre 2000).

    And you can't post graphical execution plan so that's going to be much harder to debug.

    You could always post the text execution plan and maybe we'll spot something in there.

  • Did you add the index like i suggested a few days ago ?



    Clear Sky SQL
    My Blog[/url]

  • yes i have created index and tried... still same problem...

    And i dont know how to take graphical output... the zip file has trace file, and you can open using "sql server profiler"

  • vivekvinodhraj (6/22/2011)


    yes i have created index and tried... still same problem...

    And i dont know how to take graphical output... the zip file has trace file, and you can open using "sql server profiler"

    No I'm on SQL 2008 R2 here and it errors out with can't open file because it's pre-2000.

  • ok here is the information

    Execution Tree

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

    Sort(ORDER BY:([ProductDetail].[ProductName] ASC))

    |--Table Scan(OBJECT:([SuperShop].[dbo].[ProductDetail]), WHERE:([ProductDetail].[ProductName]>=[@1]))

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

    in below text first duration was just 33, which was gradually increased to 1500 and 1406

    vent ClassDurationConnection IDSPIDStart Time

    TraceStart04:34:06.562

    Connect7991004:34:09.857

    ExistingConnection07991004:34:09.857

    Execution Plan7991004:34:09.873

    SQL:BatchCompleted07991004:34:09.873

    SQL:BatchCompleted07991004:34:09.873

    Disconnect337991004:34:09.857

    Connect8581004:34:14.217

    ExistingConnection08581004:34:14.217

    Execution Plan8581004:34:15.530

    SQL:BatchCompleted14538581004:34:14.217

    SQL:BatchCompleted308581004:34:15.670

    Disconnect15008581004:34:14.217

    Connect8591004:34:15.937

    ExistingConnection08591004:34:15.937

    Execution Plan8591004:34:17.153

    SQL:BatchCompleted13608591004:34:15.937

    SQL:BatchCompleted308591004:34:17.297

    Disconnect14068591004:34:15.937

  • Does the table have a clustered index? Is the table fragmented?

    I see no use of the index, are you sure it's there?

    What's the plan when the query runs fast?

  • yes, iam sure i have used index..

    no the table does not have clustered index and the table is not fragmented... The table is new table and it has only 4-5 items, so i think fragment is not needed....

    this is the software for an supermarket, so the query should run fast...... else there is no use of using this developing this software.

  • It takes over 1 second to return 1-5 rows from 1 table????

    Then you have serious problem somewhere on the hardware. The thing is I've never tuned a sql 7 before so I wouldn't really know where to start or what queries to send over to you to check stuff out.

  • Ok fine then, i will do onething. i will try to download new version of sql and try it..

  • vivekvinodhraj (6/23/2011)


    Ok fine then, i will do onething. i will try to download new version of sql and try it..

    Won't help if you don't plan to upgrade.

    What version are you on?

  • i think, iam using sql 2005.. i will try to download 2008 express edition and copy the database to it..

  • vivekvinodhraj (6/23/2011)


    i think, iam using sql 2005.. i will try to download 2008 express edition and copy the database to it..

    On the same server where your query is running slowly run this and paste the output here.

    SELECT @@version

Viewing 12 posts - 16 through 27 (of 27 total)

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