M
Matt
Simple example:
Open a connection loop through the data.
When I don't use .GetValues I get super fast speed,
upwards of 30,000 records per second. When use the
..GetValues I only get 5000 records per second.
Why does GetValues slow this down so much? Doesn't
the DataReader object already have the information
in memory? It should take a billionth of a second
to move it into the array...
Anyway to speed this up?
Dim myConnection As New OdbcConnection(myConnString)
Dim myCommand As New OdbcCommand(mySelectQuery, myConnection)
myConnection.Open()
Dim m_dataRead As OdbcDataReader
m_dataRead = myCommand.ExecuteReader()
Dim Elements() As Object
ReDim Elements(20) ' returning 20 fields...
While m_dataRead.Read()
'** WHEN I COMMENT OUT THIS LINE I
'** GET 30000 RECORDS PER SECOND, WHEN
'** I UNCOMMENT THIS LINE AND USE .GetValues
'** I ONLY GET 5000 RECORDS PER SECOND??
m_dataRead.GetValues(Elements)
End While
m_dataRead.Close()
myConnection.Close()
I built a job in DTS using this same ODBC Driver and SQL and
it was able to read the data at about 12000 records
per second - that includes writing it back out! How
is DTS doing it?
Thanks,
Matt
Open a connection loop through the data.
When I don't use .GetValues I get super fast speed,
upwards of 30,000 records per second. When use the
..GetValues I only get 5000 records per second.
Why does GetValues slow this down so much? Doesn't
the DataReader object already have the information
in memory? It should take a billionth of a second
to move it into the array...
Anyway to speed this up?
Dim myConnection As New OdbcConnection(myConnString)
Dim myCommand As New OdbcCommand(mySelectQuery, myConnection)
myConnection.Open()
Dim m_dataRead As OdbcDataReader
m_dataRead = myCommand.ExecuteReader()
Dim Elements() As Object
ReDim Elements(20) ' returning 20 fields...
While m_dataRead.Read()
'** WHEN I COMMENT OUT THIS LINE I
'** GET 30000 RECORDS PER SECOND, WHEN
'** I UNCOMMENT THIS LINE AND USE .GetValues
'** I ONLY GET 5000 RECORDS PER SECOND??
m_dataRead.GetValues(Elements)
End While
m_dataRead.Close()
myConnection.Close()
I built a job in DTS using this same ODBC Driver and SQL and
it was able to read the data at about 12000 records
per second - that includes writing it back out! How
is DTS doing it?
Thanks,
Matt