You can use the sqlite3_update_hook() interface to supply a callback that is invoked for (most, see documentation) INSERT, UPDATE and DELETE operations (database name, table name and rowid are passed).
You can use the sqlite3_commit_hook() and sqlite3_rollback_hook() functions to determine when the accumulated counts should be saved or discarded. Retrievals are a little more difficult, as the sqlite3_stmt_status() will only return a total number of rows retrieved across all affected tables. Alternatively you may consider implementing a statistics virtual table extension that queries the native table and counts xFilter/xNext/xUpdate calls (the easy part). Writing a good xBestIndex function may be challenging though. -----Ursprüngliche Nachricht----- Von: Sandu Buraga [mailto:[email protected]] Gesendet: Dienstag, 08. Juli 2014 11:16 An: [email protected] Betreff: [sqlite] CRUD Statistics Hi, Is there a possibility to extract a statistic of how many CRUD operations do I have during an application life-cycle? I would like to find-out how many INSERTs do I have, how many SELECTs and so on. In particular I am focusing for multithreaded scenario, with multiple read/write operations simultaneously, using WAL. Thanks Sandu _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ----------------------------------------------------------------------- Gunter Hick Software Engineer Scientific Games International GmbH Klitschgasse 2 – 4, A - 1130 Vienna, Austria FN 157284 a, HG Wien Tel: +43 1 80100 0 E-Mail: [email protected] This e-mail is confidential and may well also be legally privileged. If you have received it in error, you are on notice as to its status and accordingly please notify us immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any person as to do so could be a breach of confidence. Thank you for your cooperation. _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

