IEnumerable list looping performace issues for 50K records.

Venkata Pradeep Gudivada 0 Reputation points
2023-01-30T18:13:27.79+00:00

I have a two lists which is loaded from DB.

First List have Watermeter Data which has 50K records, Another List is AddressList which has 2.5Lakh Records,

I want to get the primary key value from AddressList by sending the LOT name (which is unique in AddressList), For joining using the Ienumerable object it's taking lot of hours.

Dim oFinalStagingList = (From oStaging In oWaterMeterStagingList, oAddr In oAddressList Where oStaging.Lot= oAddr.Lot Select { oStaging.WaterMeterStagingKey,
oStaging.Lot,
oAddr.AddressKey
}).toarray()

For Each record As Object In oFinalStagingList 'inserting the data in to DB Next

It's taking lot of hours while making the oFinalStagingList IEnumerable<Object>. Please help me how to increase the performance.

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,779 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.