Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The line While dr.Read() is SLOW!

Status
Not open for further replies.

smsinger3

Programmer
Oct 5, 2000
192
US
I run the exact same site on 2 servers. I use a datareader to cycle through my main data. It look like this:

While drRecords.Read()
Call DetailLine(intI)
End While

One one server, it very fast. On the other it is so slow it usually times out. I have narrowed the line to the first time the "While drRecords.Read()" is called. It literally takes about 75 seconds for 65 rows. The weird thing is this runs slow on a server with 4gig of ram and 4processers. It runs extrememely fast on a crappy test server.

Both servers have .Net sp2 and mdac 2.7.

Any ideas why it's running slow?

Thanks for your help!

Steve
 
could be a network problem between the web server and the data server...

possibly the "crappy" server has a better connection to the data store... this was the case once for me in ASP classic.

Keep in mind that the datareader is a connected object, so it's only going to be as fast as it's connection to the data. Generally speaking, the datareader should be a very high performance object.
penny1.gif
penny1.gif
 
For anyone interested... the entire problem was a database problem. Even though the test and database were basically defined as the same, they both were different enough that the production database used different indexes that made the entire query about 2 minutes slower that it should. How frustrating!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top