是否有一个工具来配置sqlite查询?

前端之家收集整理的这篇文章主要介绍了是否有一个工具来配置sqlite查询?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用一个sqlite数据库,并希望加快我的查询,可能与索引或通过重组它们。

是否有一个工具来配置查询,这可能有助于我决定哪里的事情正在减速?

我知道我可以只是输入查询到一个工具,如sqlite管理员来计算他们,但我正在寻找一些更有系统的东西 – 可能是在后台,查看我输入的所有查询期间,给出任何瓶颈的故障。

你在这里有很多问题。要查看运行的查询和它们需要多长时间,您需要修改sqlite3.dll(如果应用程序正在链接),或者如果它是您自己的应用程序,您可以将其写入代码更容易(我们这样做,查询,事务,定时等)。

对于单个查询分析,可以使用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.

原文链接:/sqlite/198230.html

猜你在找的Sqlite相关文章