G
Guest
I have a piece of code which goes like this.
Datareader dr = Datareader on (Select ItemName, ItemValue, LotValid from
Items where ItemName = something)
while dr.read
{
read and assign values
if LotValid = false;
break;
}
dr.close();
The issue arises when the number of records fetched by the query is high and
the LotValid boolean is false very soon.
Even when I call dr.Close(), it goes through the entire QuerySet and skips
each row individually. This hits the overall performance of the method very
badly.
Above mentioned code is just a sample scenario and optimisations like
putting the LotValid logic in the StoredProcedure cannot be done.
Datareader dr = Datareader on (Select ItemName, ItemValue, LotValid from
Items where ItemName = something)
while dr.read
{
read and assign values
if LotValid = false;
break;
}
dr.close();
The issue arises when the number of records fetched by the query is high and
the LotValid boolean is false very soon.
Even when I call dr.Close(), it goes through the entire QuerySet and skips
each row individually. This hits the overall performance of the method very
badly.
Above mentioned code is just a sample scenario and optimisations like
putting the LotValid logic in the StoredProcedure cannot be done.