是否有一个工具来配置查询,这可能有助于我决定哪里的事情正在减速?
我知道我可以只是输入查询到一个工具,如sqlite管理员来计算他们,但我正在寻找一些更有系统的东西 – 可能是在后台,查看我输入的所有查询期间,给出任何瓶颈的故障。
对于单个查询分析,可以使用EXPLAIN。它不会告诉你查询中每个步骤的时间,但它会告诉你如何执行查询。
http://www.sqlite.org/lang_explain.html
An sql statement can be preceded by the keyword “EXPLAIN” or by the phrase “EXPLAIN QUERY PLAN”. Either modification causes the sql statement to behave as a query and to return information about how the sql statement would have operated if the EXPLAIN keyword or phrase had been omitted.
When the EXPLAIN keyword appears by itself it causes the statement to behave as a query that returns the sequence of virtual machine instructions it would have used to execute the command had the EXPLAIN keyword not been present. When the EXPLAIN QUERY PLAN phrase appears,the statement returns high-level information about what indices would have been used.
The output from EXPLAIN and EXPLAIN QUERY PLAN is intended for interactive analysis and troubleshooting only. The details of the output format are subject to change from one release of sqlite to the next. Applications should not use EXPLAIN or EXPLAIN QUERY PLAN since their exact behavior is undocumented,unspecified,and variable.