Eric, Thanks for the quick response. > Sounds to me like the matching rows are located near the beginning of > the table's physical storage, so you get them quickly, and then the next > sqlite3_step() has to scan the rest of the table.
An idea worth testing, but using the official sqlite3 console application to do the same query on the same data happens in an eye-blink. What I was more suspicious of was that maybe once all the data has been collected that there's a cleanup phase occurring in sqlite.dll when calling that final sqlite_step. Note that I have not yet called sqlite3_reset or sqlite3_finalize, the problem is with the final sqlite3_step which returns SQLITE_DONE. Regards, Carl.