Hello ady, I'd hazard a guess that SQLite Admin does something that caches the file data in memory. If you do the select twice in a row. How fast is it the second time on the C++ code?
I've found that opening the DB file using regular windows calls and simply reading it to the end, closing it and THEN doing SQLite stuff to it, gets rid of slow initial performance. C Monday, September 20, 2010, 8:49:07 AM, you wrote: a> Hi a> I have found that a select is slow when run through C++ code compared to a> SQLite Administrator a> I am executing SELECT * FROM docs WHERE (mail_index MATCH ('*FirstRun')) a> ORDER BY CREATED_TIME DESC a> int nRet = sqlite3_prepare(mpDB, szSQL, -1, &pVM, &szTail); a> nRet = sqlite3_step(pVM); a> SQLite Admin does it in 47ms and the CPP code takes 140 ms a> Wonder what could be wrong ? a> -Ady a> _______________________________________________ a> sqlite-users mailing list a> sqlite-users@sqlite.org a> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users -- Best regards, Teg mailto:t...@djii.com _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users