Please help! Extremely slow table query...

  • If you want to test for a network/display type issue, then change your SELECT query to a SELECT .. INTO #temp and time that. If it is significantly faster, then you've probably got a problem with you network or your local display speed.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Are you returning ALL the rows and ALL the columns? If not, what is your WHERE clause? Have you looked at your execution plan?

    Have you checked blocks? SELECT * FROM sys.dm_exec_requests AS DER check wait_type and last_wait_type.

  • RBarryYoung (8/12/2009)


    If you want to test for a network/display type issue, then change your SELECT query to a SELECT .. INTO #temp and time that. If it is significantly faster, then you've probably got a problem with you network or your local display speed.

    Or you could go to Query -> Query Options -> Results and check the discard results after execution setting.

  • How big is each row (in bytes)? What type of network are you on 10MB/100MB/1000MB? Are connected to the network via a switch or hub?

  • Jack Corbett (8/12/2009)


    Are you returning ALL the rows and ALL the columns? If not, what is your WHERE clause? Have you looked at your execution plan?

    Have you checked blocks? SELECT * FROM sys.dm_exec_requests AS DER check wait_type and last_wait_type.

    Unfortunately, I don't have SHOWPLAN rights to the DB in question (don't ask me why).

    The query is simply: SELECT * FROM Policies.

    When I run the query you listed, I only get 1 record returned...

    wait_type = NULL and last_wait_type = MISCELLANEOUS

  • Lynn Pettis (8/12/2009)


    How big is each row (in bytes)? What type of network are you on 10MB/100MB/1000MB? Are connected to the network via a switch or hub?

    I'm sorry, I'm not really DBA type, so I'm not sure how to tell how big the row is in bytes... Should I post the CREATE TABLE script?

    I am on my company's intranet. I'm connected to a wall socket via CAT-5 cable... that's all I know...

    JOsh

  • Jack Corbett (8/12/2009)


    RBarryYoung (8/12/2009)


    If you want to test for a network/display type issue, then change your SELECT query to a SELECT .. INTO #temp and time that. If it is significantly faster, then you've probably got a problem with you network or your local display speed.

    Or you could go to Query -> Query Options -> Results and check the discard results after execution setting.

    I tried this and it does not seem to run any faster (although I terminated execution after about 15 minutes...)

    So does this mean its NOT a network bandwidth issue?

    Thanks!

    Josh

  • I'm going to go out on limb here, but the problem isn't your query. It is the amount of data you are trying to pull down to you desktop system. Do you really need to pull down all 600,000+ records and all 55 columns?

    Just curious, but what are you trying to accomplish?

  • Jack Corbett (8/12/2009)


    RBarryYoung (8/12/2009)


    If you want to test for a network/display type issue, then change your SELECT query to a SELECT .. INTO #temp and time that. If it is significantly faster, then you've probably got a problem with you network or your local display speed.

    Or you could go to Query -> Query Options -> Results and check the discard results after execution setting.

    Hmmm, hadn't thought of that. I wonder if this is implemented on the client-side or the server-side though?

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • jbarker4682 (8/12/2009)


    Lynn Pettis (8/12/2009)


    How big is each row (in bytes)? What type of network are you on 10MB/100MB/1000MB? Are connected to the network via a switch or hub?

    I'm sorry, I'm not really DBA type, so I'm not sure how to tell how big the row is in bytes... Should I post the CREATE TABLE script?

    I am on my company's intranet. I'm connected to a wall socket via CAT-5 cable... that's all I know...

    JOsh

    you say are on the company intranet....are you accessing via LAN or WAN? (are you at a remote office ?)

    what type of data do all these columns hold...is it just numbers or is there a lot of text as well?

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • jbarker4682 (8/12/2009)


    Jack Corbett (8/12/2009)


    RBarryYoung (8/12/2009)


    If you want to test for a network/display type issue, then change your SELECT query to a SELECT .. INTO #temp and time that. If it is significantly faster, then you've probably got a problem with you network or your local display speed.

    Or you could go to Query -> Query Options -> Results and check the discard results after execution setting.

    I tried this and it does not seem to run any faster (although I terminated execution after about 15 minutes...)

    So does this mean its NOT a network bandwidth issue?

    Well, I'm not sure if this is implemented before or after the network transmission, so I'd suggest trying the SELECT .. INTO first before we try to call it.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Are there any open transactions? Something holding some rows "open"? This should be trying to put some find of table lock down on the table, so something preventing that lock from happening would delay the process.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

Viewing 12 posts - 1 through 13 (of 13 total)

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