Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7404749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:18:00+00:00 2026-05-29T05:18:00+00:00

I am running into timeout issues with a very straightforward query. It seems to

  • 0

I am running into timeout issues with a very straightforward query. It seems to be because it can potentially return a very large number of results.

It’s working against a table that stores an edge list for a weighted graph:

CREATE TABLE Graph
    (Node1 int not null,
     Node2 int not null,
     Weight real not null,
     UNIQUE NONCLUSTERED (Node1, Node2))

The query is simply searching for a particular Node1:

SELECT Node1, Node2, Weight from Graph where Node1 = @node1

The query plan is okayish – a nonclustered index seek and a RID lookup. Naturally I’m going to have to see if I can get that unique nonclustered index switched over to a primary key. This table’s huge (about 60 gigs, data and index) so I’m sure the disk is getting one heck of a workout.

I’m worried that won’t entirely solve my problem, though. The timeout happens after I’ve had quite a lot of time to spin through my SqlDataReader, and I’m not having any responsiveness issues with the reader itself – the server’s being perfectly communicative. I suspect the real problem is related to this note from the documentation for SqlCommand.CommandTimeout:

This property is the cumulative time-out for all network reads during command execution or processing of the results. A time-out can still occur after the first row is returned, and does not include user processing time, only network read time.

It seems I’m getting the timeout on queries that return particularly large result sets, simply because it takes a while to transfer them over the network. Is there a better way to be doing this? It seems there should be some way to say, “I only want a timeout in the event of an actual failure to communicate.”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:18:01+00:00Added an answer on May 29, 2026 at 5:18 am

    when a real failure happens you usually get an exception…

    IF you are really sure that you want to deal with this client-side (instead of optimizing the server-side for example by giving the server 128 GB of RAM) then you could

    SqlCommand.CommandTimeout = 0; // or an extremely high value
    

    According to MSDN this represents “no timeout”.

    alternatively you can run this command on a connection opened with context connection=true in its connection string…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application keeps running into Timeout Expired SqlExceptions. The thing is that this query
We're running into issues with how we specify font sizes. If we specify the
I am running into an issue where HttpWebRequest won't respect a timeout value higher
Running into a problem where on certain servers we get an error that the
Running into a problem. I have a table defined to hold the values of
Been running into this problem lately... When debugging an app in VS.Net 2005, breakpoints
I'm running into an issue where I have a FileUpload control in an UpdatePanel.
I am currently running into a problem where an element is coming back from
I'm running into a mental roadblock here and I'm hoping that I'm missing something
I'm running into a problem setting up my development environment. I've been working on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.