Объяснение sqlite_stat1 таблицы

Я пытаюсь диагностировать, почему конкретный запрос является медленным против SQLite. Кажется, существует много информации о том, как оптимизатор запросов работает, но скудная информация о том, как на самом деле диагностировать проблемы.

В частности, когда я анализирую базу данных, я получаю ожидаемую sqlite_stat1 таблицу, но я не знаю то, что столбец статистики говорит мне. Строка в качестве примера:

MyTable,ix_id,25112 1 1 1 1

Что делает "25112 1 1 1 1" на самом деле средний?

Как более широкий вопрос, у кого-либо есть какие-либо хорошие ресурсы на лучших инструментах и методах для диагностирования производительности запросов SQLite?

Спасибо

9
задан Kent Boogaart 16 March 2010 в 16:33
поделиться

1 ответ

from 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.
5
ответ дан 4 December 2019 в 23:05
поделиться
Другие вопросы по тегам:

Похожие вопросы: