加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

sqlite_stat1表的说明

发布时间:2020-12-12 19:08:20 所属栏目:百科 来源:网络整理
导读:我正在尝试诊断为什么特定查询对SQLite的速度很慢.关于 how the query optimizer works似乎有很多信息,但关于如何实际诊断问题的信息很少. 特别是,当我分析数据库时,我得到了预期的sqlite_stat1表,但我不知道stat列告诉我什么.示例行是: MyTable,ix_id,2511
我正在尝试诊断为什么特定查询对SQLite的速度很慢.关于 how the query optimizer works似乎有很多信息,但关于如何实际诊断问题的信息很少.

特别是,当我分析数据库时,我得到了预期的sqlite_stat1表,但我不知道stat列告诉我什么.示例行是:

MyTable,ix_id,25112 1 1 1 1

“25112 1 1 1 1”究竟是什么意思?

作为一个更广泛的问题,有没有人有关于诊断SQLite查询性能的最佳工具和技术的任何好资源?

谢谢

来自analyze.c:
/* Store the results.  
**
** The result is a single row of the sqlite_stmt1 table.  The first
** two columns are the names of the table and index.  The third column
** is a string composed of a list of integer statistics about the
** index.  The first integer in the list is the total number of entires
** in the index.  There is one additional integer in the list for each
** column of the table.  This additional integer is a guess of how many
** rows of the table the index will select.  If D is the count of distinct
** values and K is the total number of rows,then the integer is computed
** as:
**
**        I = (K+D-1)/D
**
** If K==0 then no entry is made into the sqlite_stat1 table.  
** If K>0 then it is always the case the D>0 so division by zero
** is never possible.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读