Index settings and status

SHOW INDEX STATUS

SHOW INDEX STATUS is an SQL statement that displays various per-index statistics.

The syntax is:

SHOW INDEX index_name STATUS

Displayed statistics include:

  • index_type: for now that is one of disk, rt, percolate, template, and distributed.
  • indexed_documents and indexed_bytes: number of indexed documents and their text size in bytes, respectively.
  • field_tokens_XXX: sums of per-field lengths (in tokens) over the entire index (that is used internally in BM25A and BM25F functions for ranking purposes). Only available for indexes built with index_field_lengths=1.
  • ram_bytes: total size (in bytes) of RAM-resident index portion.
  • disk_bytes: total size (in bytes) of all index files.
  • disk_mapped: total size of file mappings.
  • disk_mapped_cached: total size of file mappings actually cached in RAM.
  • disk_mapped_doclists and disk_mapped_cached_doclists: part of the total and cached mappings belonging to document lists.
  • disk_mapped_hitlists and disk_mapped_cached_hitlists: part of the total and cached mappings belonging to hit lists. Values for doclists and hitlists are shown separately since they're usually huge (say, about 90% size of the whole index).
  • killed_documents and killed_rate: the first one indicates the number of deleted documents and the rate of deleted/indexed. Technically deletion of a document just means that the document gets suppressed in search output, but physically it still persists in an index and will be purged only after merging/optimizing the index.
  • ram_chunk: size of RAM chunk of real-time or percolate index.
  • ram_chunk_segments_count: RAM chunk internally consists of segments, usually there are no more than 32 of them. This line shows the current count.
  • disk_chunks: number of disk chunks of the real-time index.
  • mem_limit: actual value of rt_mem_limit for the index.
  • ram_bytes_retired: represents size of garbage in RAM chunks (for example, deleted or replaced documents not yet finally wiped away).
  • tid and tid_saved: represent the state of saving the index (real-time or percolate only). tid gets increased with each change (transaction). tid_saved shows max tid of the state saved in a RAM chunk in '.ram' file. When the numbers are different, some changes exist only in RAM and also backed by binlog (if enabled). Performing 'flush rtindex' or scheduling periodical flushing causes these changes to be saved. After flushing the binlog gets cleared, and the tid_saved represents the actual new state.
  • query_time_*: query execution time statistics of last 1 minute, 5 minutes, 15 minutes and total since server start; the data is encapsulated as a JSON object which includes the number of queries and min, max, avg, 95 and 99 percentile values.
  • found_rows_*: statistics of rows found by queries; provided for last 1 minute, 5 minutes, 15 minutes and total since server start; the data is encapsulated as a JSON object which includes the number of queries and min, max, avg, 95 and 99 percentile values.
📋
mysql> SHOW INDEX statistic STATUS;
Response
+-----------------------------+--------------------------------------------------------------------------+
| Variable_name               | Value                                                                    |
+-----------------------------+--------------------------------------------------------------------------+
| index_type                  | rt                                                                       |
| indexed_documents           | 923981                                                                   |
| indexed_bytes               | 1181846688                                                               |
| ram_bytes                   | 90453512                                                                 |
| disk_bytes                  | 855544335                                                                |
| disk_mapped                 | 848274223                                                                |
| disk_mapped_cached          | 89686016                                                                 |
| disk_mapped_doclists        | 490350852                                                                |
| disk_mapped_cached_doclists | 0                                                                        |
| disk_mapped_hitlists        | 207362625                                                                |
| disk_mapped_cached_hitlists | 0                                                                        |
| killed_documents            | 107                                                                      |
| killed_rate                 | 0.01%                                                                    |
| ram_chunk                   | 0                                                                        |
| ram_chunk_segments_count    | 0                                                                        |
| disk_chunks                 | 190                                                                      |
| mem_limit                   | 524288                                                                   |
| ram_bytes_retired           | 0                                                                        |
| tid                         | 0                                                                        |
| tid_saved                   | 0                                                                        |
| query_time_1min             | {"queries":0, "avg":"-", "min":"-", "max":"-", "pct95":"-", "pct99":"-"} |
| query_time_5min             | {"queries":0, "avg":"-", "min":"-", "max":"-", "pct95":"-", "pct99":"-"} |
| query_time_15min            | {"queries":0, "avg":"-", "min":"-", "max":"-", "pct95":"-", "pct99":"-"} |
| query_time_total            | {"queries":0, "avg":"-", "min":"-", "max":"-", "pct95":"-", "pct99":"-"} |
| exact_query_time_1min       | {"queries":0, "avg":"-", "min":"-", "max":"-", "pct95":"-", "pct99":"-"} |
| exact_query_time_5min       | {"queries":0, "avg":"-", "min":"-", "max":"-", "pct95":"-", "pct99":"-"} |
| exact_query_time_15min      | {"queries":0, "avg":"-", "min":"-", "max":"-", "pct95":"-", "pct99":"-"} |
| exact_query_time_total      | {"queries":0, "avg":"-", "min":"-", "max":"-", "pct95":"-", "pct99":"-"} |
| found_rows_1min             | {"queries":0, "avg":"-", "min":"-", "max":"-", "pct95":"-", "pct99":"-"} |
| found_rows_5min             | {"queries":0, "avg":"-", "min":"-", "max":"-", "pct95":"-", "pct99":"-"} |
| found_rows_15min            | {"queries":0, "avg":"-", "min":"-", "max":"-", "pct95":"-", "pct99":"-"} |
| found_rows_total            | {"queries":0, "avg":"-", "min":"-", "max":"-", "pct95":"-", "pct99":"-"} |
+-----------------------------+--------------------------------------------------------------------------+
32 rows in set (0,03 sec)

SHOW INDEX SETTINGS

SHOW INDEX SETTINGS is an SQL statement that displays per-index settings in a format that is compatible with the config file.

The syntax is:

SHOW INDEX index_name[.N | CHUNK N] SETTINGS

Output is similar to the --dumpconfig option of the indextool utility. The report provides a breakdown of all the index settings, including tokenizer and dictionary options.

SQL
📋
SHOW INDEX forum SETTINGS;
Response
+---------------+-----------------------------------------------------------------------------------------------------------+
| Variable_name | Value                                                                                                     |
+---------------+-----------------------------------------------------------------------------------------------------------+
| settings      | min_prefix_len = 3
charset_table = 0..9, A..Z->a..z, _, -, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F |
+---------------+-----------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

You may also specify a particular chunk number to view the settings of a particular chunk of an RT index. The number is 0-based.

SQL
📋
SHOW INDEX forum CHUNK 0 SETTINGS;
Response
+---------------+-----------------------------------------------------------------------------------------------------------+
| Variable_name | Value                                                                                                     |
+---------------+-----------------------------------------------------------------------------------------------------------+
| settings      | min_prefix_len = 3
charset_table = 0..9, A..Z->a..z, _, -, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F |
+---------------+-----------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)