473,397 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

VB.NET - Fast Databasing Problem

Hi all, ok I have this problem where I need to process 50,000+ records from three different tables on two different servers thus 150,000+ records. Now I have got this program to work, however, it runs two slow. I do the following:

Servers:
ServerA, Server B

Databases
ServerA.DB1, ServerB,DB2

Tables
DB1.TBL1, DB2.TBL1, DB2.TBL2

1) Get Row from DB1.TBL1, called CurRecord
2) Create a string from 4 records from said row, called RowID
3) find RowID in DB2.TBL1
4) Once Found get IDNumber from DB2.TBL1
5) Find IDNumber in DB2.TBL2
6) Once found get PageNumber
7) Comapre DB2.TBL2.PageNumber to DB1.TBL1.PageNumber, depending on result (i.e. = or <>) change a field in DB1.TBL1.CurRecord
Repeat until all records in DB1.TBL1 have been processed

Now I have tried, Datasets, Hashtables, only SQL, datareaders, and any combination of them to try and achieve the fastest processing time. Everyone on the MSDN forums keep telling me to use SQLBulkCopy, but that is not my issue, it is processing the information. Oh I have also tried placing a Primary Key on the tables, as well as threading. My fastest time is 1 hour, I need to get it as close to 10 minutes as possible. I am running out of ideas, hence my posting this thread. Thus my question, if you have any ideas on what I can do in VB.Net to increase processing speed of such a problem i would be most greatful. I am looking for ideas for me to research/ try You don't have to give and I am not asking for a complete answer just a nudge in the right direction is all. Thank you for you help in advance!
Jul 10 '07 #1
4 1160
Frinavale
9,735 Expert Mod 8TB
Hi all, ok I have this problem where I need to process 50,000+ records from three different tables on two different servers thus 150,000+ records. Now I have got this program to work, however, it runs two slow. I do the following:
...
Hi Cyberdaemon,

You have probably tried this already but...I'll ask anyways.
Have you thought of returning a fewer number of records to your application and just grabbing the next "batch" as they are requested instead of doing a huge return?
Jul 10 '07 #2
Lokean
71
Hi all, ok I have this problem where I need to process 50,000+ records from three different tables on two different servers thus 150,000+ records. Now I have got this program to work, however, it runs two slow. I do the following:

Servers:
ServerA, Server B

Databases
ServerA.DB1, ServerB,DB2

Tables
DB1.TBL1, DB2.TBL1, DB2.TBL2

1) Get Row from DB1.TBL1, called CurRecord
2) Create a string from 4 records from said row, called RowID
3) find RowID in DB2.TBL1
4) Once Found get IDNumber from DB2.TBL1
5) Find IDNumber in DB2.TBL2
6) Once found get PageNumber
7) Comapre DB2.TBL2.PageNumber to DB1.TBL1.PageNumber, depending on result (i.e. = or <>) change a field in DB1.TBL1.CurRecord
Repeat until all records in DB1.TBL1 have been processed

Now I have tried, Datasets, Hashtables, only SQL, datareaders, and any combination of them to try and achieve the fastest processing time. Everyone on the MSDN forums keep telling me to use SQLBulkCopy, but that is not my issue, it is processing the information. Oh I have also tried placing a Primary Key on the tables, as well as threading. My fastest time is 1 hour, I need to get it as close to 10 minutes as possible. I am running out of ideas, hence my posting this thread. Thus my question, if you have any ideas on what I can do in VB.Net to increase processing speed of such a problem i would be most greatful. I am looking for ideas for me to research/ try You don't have to give and I am not asking for a complete answer just a nudge in the right direction is all. Thank you for you help in advance!
Have you tried CLR integration?
Jul 10 '07 #3
First off thank you for your replies, they are much appriciated!

In Regards to Frinavale:

During my research I found that the datareader was the best in performance, as reading the data goes. And I was under the impression that the datareader.read() method already read in batches, I will look further into this. Maybe I was mistaken and have to explicitly do the read in batches.

In Regards to Lokean:

I am not familiar with CLR integration, I will look into this.
Jul 10 '07 #4
I did some research and found I was wrong about the .read method of the datareader. so how would I go about reading in batches? My idea would be to create a datatable and then read like 500 records into it, process those records then read the next 500.

Is this method of batching efficient? or is there a better way?

Would it be better to do my prev idea but read on one thread, process on another? I have tried threading before but it made my program slower, it was however my first attempt at threading so I might have messed it up.

In regards to the CLR Integreation, from what I read it must be done on the server. I do not have that ability, this program will most likely be running on a client PC, and if it was on a server not the server with the databases.

Thank you for your help, if any one has any other ideas for me to look at or answers to my questions it would be most helpful.
Jul 16 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Neil | last post by:
I have a very puzzling situation with a database. It's an Access 2000 mdb with a SQL 7 back end, with forms bound using ODBC linked tables. At our remote location (accessed via a T1 line) the time...
22
by: Marc Mones | last post by:
Hello, I'working with IBM DB2 V8.1 and CLI/ODBC. I've got a problem with the following statement: ******************************************************************************** SELECT...
20
by: GS | last post by:
The stdint.h header definition mentions five integer categories, 1) exact width, eg., int32_t 2) at least as wide as, eg., int_least32_t 3) as fast as possible but at least as wide as, eg.,...
2
by: Frank Swarbrick | last post by:
I had asked a question a few weeks ago about having problems at times accessing DB2 Express-C 9.1, and getting "SQL1032N No start database manager command was issued. SQLSTATE=57019" even when the...
13
by: Arno R | last post by:
Hi all, I am deploying an A2k app to users with different versions of Access. Using Access 2000 the relinking on startup (on deploying a new frontend or when backend has changed) is very fast....
95
by: hstagni | last post by:
Where can I find a library to created text-based windows applications? Im looking for a library that can make windows and buttons inside console.. Many old apps were make like this, i guess ...
0
by: Vinod Sadanandan | last post by:
Fast-Start Failover An Overview In Dataguard Environment ============================================================================= This article describes the automatic fast start failover...
4
by: Ty | last post by:
Hi all Short version of my problem: i have a Datagrid (Flexgrid from ComponentOne) with a Datatable as source. I need to search a row in the datatable, using a primary key column in the...
9
by: Salad | last post by:
I have access, for testing at my client's site, a Win2000 computer running A2003 retail. He recently upgraded all of his other machines to DualCore Pentiums with 2 gig ram and run A2003 runtime. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.