D
dror
Hello,
I have a problem that actually doesn't even make sense.
I have 4 million rows in my database. I want to get all records into a
DataReader and then read. So if I do it in DAO (either in VB or MFC C++)
it takes around 1 second to get the recordset and then around 10-15
seconds to iterate through the recordset. This speed remains the same even
if I incorporate an ORDER BY clause:
SELECT * FROM myTable ORDER BY customer_id, order_Date;
Without the ORDER BY statement i obtain the same speed in C# using
ado.net. I tested the four possibilities:
1. using OLE DB data provider with Ms Access.
2. using ODBC data provider with Ms Access.
3. using ODBC data provider with Sql Server.
4. using SqlClient data provider with Sql Server.
BUT, when I incorporated the ORDER BY clause each of the first three took
around 3 minutes!!! (the forth was around 30 seconds which is still very
very slow compared to the DAO (which is an older technology and depricated
in vs.net). NOTE: all the extra time is from the method
DbCommand.ExecuteReader() not from iterating through the dataReader.
It's not a question of reducing the size of data i retrieve or indexing
the relevant fields in the database as I want to achieve with ado.net the
same speed I get with DAO. In my experiment I use the same database, same
tables and corresponding objects (as a RecordSet in DAO is the same as a
DataReader in ado.net).
Another thing i noticed is that i use a dynaset in DAO (which no longer
exists in ado.net). Still need to find a solution for this problem.
Thanks,
Dror
I have a problem that actually doesn't even make sense.
I have 4 million rows in my database. I want to get all records into a
DataReader and then read. So if I do it in DAO (either in VB or MFC C++)
it takes around 1 second to get the recordset and then around 10-15
seconds to iterate through the recordset. This speed remains the same even
if I incorporate an ORDER BY clause:
SELECT * FROM myTable ORDER BY customer_id, order_Date;
Without the ORDER BY statement i obtain the same speed in C# using
ado.net. I tested the four possibilities:
1. using OLE DB data provider with Ms Access.
2. using ODBC data provider with Ms Access.
3. using ODBC data provider with Sql Server.
4. using SqlClient data provider with Sql Server.
BUT, when I incorporated the ORDER BY clause each of the first three took
around 3 minutes!!! (the forth was around 30 seconds which is still very
very slow compared to the DAO (which is an older technology and depricated
in vs.net). NOTE: all the extra time is from the method
DbCommand.ExecuteReader() not from iterating through the dataReader.
It's not a question of reducing the size of data i retrieve or indexing
the relevant fields in the database as I want to achieve with ado.net the
same speed I get with DAO. In my experiment I use the same database, same
tables and corresponding objects (as a RecordSet in DAO is the same as a
DataReader in ado.net).
Another thing i noticed is that i use a dynaset in DAO (which no longer
exists in ado.net). Still need to find a solution for this problem.
Thanks,
Dror