V
Veerabhadraiah L M
Hi,
I have two databases D1 with 6 million records and D2 with 95 thousand
records. I need to check Common records from these two databases based on
UserID and need to insert into other database D3 and also need to create XML
files.
For this i followed below approach.
I have used two threads.
-->one thread to Pick the users from D1, filter out against D2 and will be
inserting into D3.
In this thread iam fetching 5000 records everytime and for each user
Calling an event using delegate. in this event iam filtering against D2
database and inserting user into D3 database as follows.
Public void Run()
{
While(!Stop)
{
--Here fetching 5000 records ranging from 240000 to 290000 against D1
database (Querying D1 database)
-- calling a event using delegate for each Record.
-- Filtering each record against D2 database (Querying D2 database)
-- If exists Inserting into D3 database or if not exists then
returning loop to process the next record.
}
}
-->other thread fetches all the records from D3 database and writes to Xml
files.
-- this thread fetches the records say 1000(after filtering out) at one
time (Querying D3 database)
-- here also i have created delegate which calls an event for each record.
-- for each user the data will be written to xml file
Now i have an issue with this, its killing the perfomance. can anyone please
help me on this as how to improve performance.
Iam using .Net 1.1 for development and SQL 2000 as backend.
Thanks,
-Veera
I have two databases D1 with 6 million records and D2 with 95 thousand
records. I need to check Common records from these two databases based on
UserID and need to insert into other database D3 and also need to create XML
files.
For this i followed below approach.
I have used two threads.
-->one thread to Pick the users from D1, filter out against D2 and will be
inserting into D3.
In this thread iam fetching 5000 records everytime and for each user
Calling an event using delegate. in this event iam filtering against D2
database and inserting user into D3 database as follows.
Public void Run()
{
While(!Stop)
{
--Here fetching 5000 records ranging from 240000 to 290000 against D1
database (Querying D1 database)
-- calling a event using delegate for each Record.
-- Filtering each record against D2 database (Querying D2 database)
-- If exists Inserting into D3 database or if not exists then
returning loop to process the next record.
}
}
-->other thread fetches all the records from D3 database and writes to Xml
files.
-- this thread fetches the records say 1000(after filtering out) at one
time (Querying D3 database)
-- here also i have created delegate which calls an event for each record.
-- for each user the data will be written to xml file
Now i have an issue with this, its killing the perfomance. can anyone please
help me on this as how to improve performance.
Iam using .Net 1.1 for development and SQL 2000 as backend.
Thanks,
-Veera