I am having a strange performance problem with ATL/OLEDB (C++).
When I iterate over a recordset, I use the MoveNext method to move to the next record. So when I measured the time it takes to execute the MoveNext method, the very last invocation (which sets the handle to DB_S_ENDOFROWSET) takes a very long time. Quantitatively here is some data:
- Normal Movenext() takes about 20 microseconds on average.
- Final MoveNext() which sets the handle to DB_S_ENDOFROWSET takes 650000 microseconds.
Has anyone else seen this behavior?
Another really weird observation is that this problem seems to be dependent on the indexes that have been defined for the database. IOW, if I alter my index definitions, this performance issue goes away.
Does anyone have a clue about what is going on?
I am using SQL Server CE 4.0.