sqlite_stat1表的说明

前端之家收集整理的这篇文章主要介绍了sqlite_stat1表的说明前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试诊断为什么特定查询sqlite的速度很慢.关于 how the query optimizer works似乎有很多信息,但关于如何实际诊断问题的信息很少.

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

  1. MyTable,ix_id,25112 1 1 1 1

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

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

谢谢

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

猜你在找的Sqlite相关文章