logo

SQLite C Interface: Tracing And Profiling Functions

日期:2008-02-09 14:13 , 点击:255 , 分类:Sqlite新闻
相关标签:profile,



SQLite C Interface

Tracing And Profiling Functions

void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
void *sqlite3_profile(sqlite3*,
   void(*xProfile)(void*,const char*,sqlite3_uint64), void*);

These routines register callback functions that can be used for tracing and profiling the execution of SQL statements.

The callback function registered by sqlite3_trace() is invoked at the first sqlite3_step() for the evaluation of an SQL statement. Only a single trace callback can be registered at a time. Each call to sqlite3_trace() overrides the previous. A NULL callback for sqlite3_trace() disables tracing. The first argument to the trace callback is a copy of the pointer which was the 3rd argument to sqlite3_trace. The second argument to the trace callback is a zero-terminated UTF8 string containing the original text of the SQL statement as it was passed into sqlite3_prepare_v2() or the equivalent. Note that the host parameter are not expanded in the SQL statement text.

The callback function registered by sqlite3_profile() is invoked as each SQL statement finishes. The first parameter to the profile callback is a copy of the 3rd parameter to sqlite3_profile(). The second parameter to the profile callback is a zero-terminated UTF-8 string that contains the complete text of the SQL statement as it was processed by sqlite3_prepare_v2() or the equivalent. The third parameter to the profile callback is an estimate of the number of nanoseconds of wall-clock time required to run the SQL statement from start to finish.

The sqlite3_profile() API is currently considered experimental and is subject to change.

See also lists of Objects, Constants, and Functions.



SQLite C Interface: Tracing And Profiling Functions 评论

# 昵称:

# 邮箱:

# 标题:

* 请勿发布任何违反国家互联网相关法律法规的内容

    



站内搜索




* 匹配全部


热门排行


最新内容



Copyright © 2008 Sqlite中文实验室 版权所有
蜀ICP备08000081号 -

Powered By xydw.com Page Loaded in:0.182959s