Have you timed the entire application instead of just the SQL query?
 
Put both apps inside a system() call  and time those.
 
Are you sure they are both compiled with the same optimization?
 
Michael D. Black
Senior Scientist
Advanced Analytics Directorate
Northrop Grumman Information Systems
 

________________________________

From: sqlite-users-boun...@sqlite.org on behalf of ady
Sent: Mon 9/20/2010 7:49 AM
To: sqlite-users@sqlite.org
Subject: EXTERNAL:[sqlite] SELECT is Slow when run in C++ code compared to 
SQLite Administrator



Hi

I have found that a select is slow when run through C++ code compared to
SQLite Administrator

I am executing SELECT * FROM docs WHERE (mail_index MATCH ('*FirstRun'))
ORDER BY CREATED_TIME DESC

    int nRet = sqlite3_prepare(mpDB, szSQL, -1, &pVM, &szTail);
    nRet = sqlite3_step(pVM);



SQLite Admin does it in 47ms and the CPP code takes 140 ms

Wonder what could be wrong ?

-Ady
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to