On 4/22/2011 10:32 AM, Scott Zhang wrote:
> Hello.
> I am using Sqlite3 in my applicaiton. I have a simple table:
>
> CREATE TABLE doc_cat_link (
> id INTEGER PRIMARY KEY,
> doc_id INTEGER,
> cat_id INTEGER,
> [ACTION] TEXT DEFAULT '',
> is_dirty INTEGER
> );
>
> the problem is it only has 10 rows, but each time I delete a row using
> "delete from doc_cat_link where doc_id=?" in my application, it took
> about 200ms.
>
> After tracking down to the real function call,
> [code]
> wxLogMessage(wxString::Format(_T("ExecuteUpdate1 is %d\n"), clock()));
> int rc = sqlite3_step((sqlite3_stmt*) m_stmt);
> wxLogMessage(wxString::Format(_T("ExecuteUpdate1 is %d\n"), clock()));
I wonder how long it takes to run wxLogMessage and wxString::Format -
you are including them in the running time. Try it this way:
int clock_before = clock();
int rc = sqlite3_step((sqlite3_stmt*) m_stmt);
int clock_after = clock();
wxLogMessage(wxString::Format(_T("sqlite3_step took %d ms\n"),
clock_after - clock_before));
--
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users