SHOW META

SHOW META [ LIKE pattern ]

SHOW META is an SQL statement that displays additional meta-information about the processed query, including the query time, keyword statistics, and information about the secondary indexes used. The syntax is:

The included items are:

  • total: The number of matches that were actually retrieved and sent to the client. This value is typically limited by the LIMIT/size search option.
  • total_found:
  • The estimated total number of matches for the query in the index. If you need the exact number of matches, use SELECT COUNT(*) instead of relying on this value.
  • For queries with GROUP BY, total_found represents the number of groups instead of individual matches.
  • When using HAVING with GROUP BY, total_found reflects the number of groups after the HAVING filter is applied. This enables proper pagination with HAVING clauses.
  • For GROUP N BY queries, total_found still represents the number of groups, regardless of the value of N.
  • total_relation: Indicates whether the total_found value is exact or an estimate.
  • If Manticore cannot determine the precise total_found value, this field will display total_relation: gte, meaning the actual number of matches is Greater Than or Equal to the reported total_found.
  • If the total_found value is exact, total_relation: eq will be displayed.
  • time: The duration (in seconds) it took to process the search query.
  • keyword[N]: The n-th keyword used in the search query. Note that the keyword can be presented as a wildcard, e.g., abc*.
  • docs[N]: The total number of documents (or records) containing the n-th keyword from the search query. If the keyword is presented as a wildcard, this value represents the sum of documents for all expanded sub-keywords, potentially exceeding the actual number of matched documents.
  • hits[N]: The total number of occurrences (or hits) of the n-th keyword across all documents.
  • index: Information about the utilized index (e.g., secondary index).

‹›

  • SQL
  • JSON

SQL JSON

📋

⚙

SELECT id, story_author FROM hn_small WHERE MATCH('one|two|three') and comment_ranking > 2 limit 5;
show meta;
POST /sql?mode=raw -d "SELECT id, story_author FROM hn_small WHERE MATCH('one|two|three') and comment_ranking > 2 limit 5; SHOW META"

‹›

Response

+---------+--------------+
| id      | story_author |
+---------+--------------+
|  151171 | anewkid      |
|  302758 | bks          |
|  805806 | drRoflol     |
| 1099245 | tnorthcutt   |
|  303252 | whiten       |
+---------+--------------+
5 rows in set (0.00 sec)
+----------------+---------------------------------------+
| Variable_name  | Value                                 |
+----------------+---------------------------------------+
| total          | 5                                     |
| total_found    | 2308                                  |
| total_relation | eq                                    |
| time           | 0.001                                 |
| keyword[0]     | one                                   |
| docs[0]        | 224387                                |
| hits[0]        | 310327                                |
| keyword[1]     | three                                 |
| docs[1]        | 18181                                 |
| hits[1]        | 21102                                 |
| keyword[2]     | two                                   |
| docs[2]        | 63251                                 |
| hits[2]        | 75961                                 |
| index          | comment_ranking:SecondaryIndex (100%) |
+----------------+---------------------------------------+
14 rows in set (0.00 sec)
[
  {
    "columns": [
      {
        "id": {
          "type": "long long"
        }
      },
      {
        "story_author": {
          "type": "string"
        }
      }
    ],
    "data": [
      {
        "id": 151171,
        "story_author": "anewkid"
      },
      {
        "id": 302758,
        "story_author": "bks"
      },
      {
        "id": 805806,
        "story_author": "drRoflol"
      },
      {
        "id": 1099245,
        "story_author": "tnorthcutt"
      },
      {
        "id": 303252,
        "story_author": "whiten"
      }
    ],
    "total": 5,
    "error": "",
    "warning": ""
  },
  {
    "columns": [
      {
        "Variable_name": {
          "type": "string"
        }
      },
      {
        "Value": {
          "type": "string"
        }
      }
    ],
    "data": [
      {
        "Variable_name": "total",
        "Value": "5"
      },
      {
        "Variable_name": "total_found",
        "Value": "2308"
      },
      {
        "Variable_name": "total_relation",
        "Value": "eq"
      },
      {
        "Variable_name": "time",
        "Value": "0.001"
      },
      {
        "Variable_name": "keyword[0]",
        "Value": "one"
      },
      {
        "Variable_name": "docs[0]",
        "Value": "224387"
      },
      {
        "Variable_name": "hits[0]",
        "Value": "310327"
      },
      {
        "Variable_name": "keyword[1]",
        "Value": "three"
      },
      {
        "Variable_name": "docs[1]",
        "Value": "18181"
      },
      {
        "Variable_name": "hits[1]",
        "Value": "21102"
      },
      {
        "Variable_name": "keyword[2]",
        "Value": "two"
      },
      {
        "Variable_name": "docs[2]",
        "Value": "63251"
      },
      {
        "Variable_name": "hits[2]",
        "Value": "75961"
      },
      {
        "Variable_name": "index",
        "Value": "comment_ranking:SecondaryIndex (100%)"
      }
    ],
    "total": 14,
    "error": "",
    "warning": ""
  }
]

‹›

SHOW META can display I/O and CPU counters, but they will only be available if searchd was started with the --iostats and --cpustats switches, respectively.

‹›

  • SQL
  • JSON

SQL JSON

📋

⚙

SELECT id,channel_id FROM records WHERE MATCH('one|two|three') limit 5;
SHOW META;
POST /sql?mode=raw -d "SELECT id,channel_id FROM records WHERE MATCH('one|two|three') limit 5; SHOW META"

‹›

Response

+--------+--------------+
| id     | story_author |
+--------+--------------+
| 300263 | throwaway37  |
| 713503 | mahmud       |
| 716804 | mahmud       |
| 776906 | jimbokun     |
| 753332 | foxhop       |
+--------+--------------+
5 rows in set (0.01 sec)
+-----------------------+--------+
| Variable_name         | Value  |
+-----------------------+--------+
| total                 | 5      |
| total_found           | 266385 |
| total_relation        | eq     |
| time                  | 0.011  |
| cpu_time              | 18.004 |
| agents_cpu_time       | 0.000  |
| io_read_time          | 0.000  |
| io_read_ops           | 0      |
| io_read_kbytes        | 0.0    |
| io_write_time         | 0.000  |
| io_write_ops          | 0      |
| io_write_kbytes       | 0.0    |
| agent_io_read_time    | 0.000  |
| agent_io_read_ops     | 0      |
| agent_io_read_kbytes  | 0.0    |
| agent_io_write_time   | 0.000  |
| agent_io_write_ops    | 0      |
| agent_io_write_kbytes | 0.0    |
| keyword[0]            | one    |
| docs[0]               | 224387 |
| hits[0]               | 310327 |
| keyword[1]            | three  |
| docs[1]               | 18181  |
| hits[1]               | 21102  |
| keyword[2]            | two    |
| docs[2]               | 63251  |
| hits[2]               | 75961  |
+-----------------------+--------+
27 rows in set (0.00 sec)
[
  {
    "columns": [
      {
        "id": {
          "type": "long long"
        }
      },
      {
        "story_author": {
          "type": "string"
        }
      }
    ],
    "data": [
      {
        "id": 300263,
        "story_author": "throwaway37"
      },
      {
        "id": 713503,
        "story_author": "mahmud"
      },
      {
        "id": 716804,
        "story_author": "mahmud"
      },
      {
        "id": 776906,
        "story_author": "jimbokun"
      },
      {
        "id": 753332,
        "story_author": "foxhop"
      }
    ],
    "total": 5,
    "error": "",
    "warning": ""
  },
  {
    "columns": [
      {
        "Variable_name": {
          "type": "string"
        }
      },
      {
        "Value": {
          "type": "string"
        }
      }
    ],
    "data": [
      {
        "Variable_name": "total",
        "Value": "5"
      },
      {
        "Variable_name": "total_found",
        "Value": "266385"
      },
      {
        "Variable_name": "total_relation",
        "Value": "eq"
      },
      {
        "Variable_name": "time",
        "Value": "0.001"
      },
      {
        "Variable_name": "cpu_time",
        "Value": "18.004"
      },
      {
        "Variable_name": "agents_cpu_time",
        "Value": "0.000"
      },
      {
        "Variable_name": "io_read_time",
        "Value": "0.000"
      },
      {
        "Variable_name": "io_read_ops",
        "Value": "0"
      },
      {
        "Variable_name": "io_read_kbytes",
        "Value": "0.0"
      },
      {
        "Variable_name": "io_write_time",
        "Value": "0.000"
      },
      {
        "Variable_name": "io_write_ops",
        "Value": "0"
      },
      {
        "Variable_name": "io_write_kbytes",
        "Value": "0.0"
      },
      {
        "Variable_name": "agent_io_read_time",
        "Value": "0.000"
      },
      {
        "Variable_name": "agent_io_read_ops",
        "Value": "0"
      },
      {
        "Variable_name": "agent_io_read_kbytes",
        "Value": "0.0"
      },
      {
        "Variable_name": "agent_io_write_time",
        "Value": "0.000"
      },
      {
        "Variable_name": "agent_io_write_ops",
        "Value": "0"
      },
      {
        "Variable_name": "agent_io_write_kbytes",
        "Value": "0.0"
      },
      {
        "Variable_name": "keyword[0]",
        "Value": "one"
      },
      {
        "Variable_name": "docs[0]",
        "Value": "224387"
      },
      {
        "Variable_name": "hits[0]",
        "Value": "310327"
      },
      {
        "Variable_name": "keyword[1]",
        "Value": "three"
      },
      {
        "Variable_name": "docs[1]",
        "Value": "18181"
      },
      {
        "Variable_name": "hits[1]",
        "Value": "21102"
      },
      {
        "Variable_name": "keyword[2]",
        "Value": "two"
      },
      {
        "Variable_name": "docs[2]",
        "Value": "63251"
      },
      {
        "Variable_name": "hits[2]",
        "Value": "75961"
      }
    ],
    "total": 27,
    "error": "",
    "warning": ""
  }
]
SELECT id,story_author FROM hn_small WHERE MATCH('one|two|three') limit 5;
SHOW META;
+--------+--------------+
| id     | story_author |
+--------+--------------+
| 300263 | throwaway37  |
| 713503 | mahmud       |
| 716804 | mahmud       |
| 776906 | jimbokun     |
| 753332 | foxhop       |
+--------+--------------+
5 rows in set (0.01 sec)
mysql> show meta;
+---------------------+--------+
| Variable_name       | Value  |
+---------------------+--------+
| total               | 5      |
| total_found         | 266385 |
| total_relation      | eq     |
| time                | 0.012  |
| keyword[0]          | one    |
| docs[0]             | 224387 |
| hits[0]             | 310327 |
| keyword[1]          | three  |
| docs[1]             | 18181  |
| hits[1]             | 21102  |
| keyword[2]          | two    |
| docs[2]             | 63251  |
| hits[2]             | 75961  |
+---------------------+--------+
17 rows in set (0.00 sec)
POST /sql?mode=raw -d "SELECT id,story_author FROM hn_small WHERE MATCH('one|two|three') limit 5 option max_predicted_time=100; SHOW META"
[
  {
    "columns": [
      {
        "id": {
          "type": "long long"
        }
      },
      {
        "story_author": {
          "type": "string"
        }
      }
    ],
    "data": [
      {
        "id": 300263,
        "story_author": "throwaway37"
      },
      {
        "id": 713503,
        "story_author": "mahmud"
      },
      {
        "id": 716804,
        "story_author": "mahmud"
      },
      {
        "id": 776906,
        "story_author": "jimbokun"
      },
      {
        "id": 753332,
        "story_author": "foxhop"
      }
    ],
    "total": 5,
    "error": "",
    "warning": ""
  },
  {
    "columns": [
      {
        "Variable_name": {
          "type": "string"
        }
      },
      {
        "Value": {
          "type": "string"
        }
      }
    ],
    "data": [
      {
        "Variable_name": "total",
        "Value": "5"
      },
      {
        "Variable_name": "total_found",
        "Value": "266385"
      },
      {
        "Variable_name": "total_relation",
        "Value": "eq"
      },
      {
        "Variable_name": "time",
        "Value": "0.012"
      },
      {
        "Variable_name": "local_fetched_docs",
        "Value": "307212"
      },
      {
        "Variable_name": "local_fetched_hits",
        "Value": "407390"
      },
      {
        "Variable_name": "local_fetched_skips",
        "Value": "24"
      },
      {
        "Variable_name": "predicted_time",
        "Value": "56"
      },
      {
        "Variable_name": "keyword[0]",
        "Value": "one"
      },
      {
        "Variable_name": "docs[0]",
        "Value": "224387"
      },
      {
        "Variable_name": "hits[0]",
        "Value": "310327"
      },
      {
        "Variable_name": "keyword[1]",
        "Value": "three"
      },
      {
        "Variable_name": "docs[1]",
        "Value": "18181"
      },
      {
        "Variable_name": "hits[1]",
        "Value": "21102"
      },
      {
        "Variable_name": "keyword[2]",
        "Value": "two"
      },
      {
        "Variable_name": "docs[2]",
        "Value": "63251"
      },
      {
        "Variable_name": "hits[2]",
        "Value": "75961"
      }
    ],
    "total": 17,
    "error": "",
    "warning": ""
  }
]

SHOW META must be executed immediately after the query in the same session. Since some MySQL connectors/libraries use connection pools, running SHOW META in a separate statement can lead to unexpected results, such as retrieving metadata from another query. In these cases (and generally recommended), run a multiple statement containing both the query and SHOW META. Some connectors/libraries support multi-queries within the same method for a single statement, while others may require the use of a dedicated method for multi-queries or setting specific options during connection setup.

‹›

  • SQL
  • JSON

SQL JSON

📋

⚙

SELECT id,story_author FROM hn_small WHERE MATCH('one|two|three') LIMIT 5; SHOW META;
POST /sql?mode=raw -d "SELECT id,story_author FROM hn_small WHERE MATCH('one|two|three') LIMIT 5; SHOW META"

‹›

Response

+--------+--------------+
| id     | story_author |
+--------+--------------+
| 300263 | throwaway37  |
| 713503 | mahmud       |
| 716804 | mahmud       |
| 776906 | jimbokun     |
| 753332 | foxhop       |
+--------+--------------+
5 rows in set (0.01 sec)
+----------------+--------+
| Variable_name  | Value  |
+----------------+--------+
| total          | 5      |
| total_found    | 266385 |
| total_relation | eq     |
| time           | 0.011  |
| keyword[0]     | one    |
| docs[0]        | 224387 |
| hits[0]        | 310327 |
| keyword[1]     | three  |
| docs[1]        | 18181  |
| hits[1]        | 21102  |
| keyword[2]     | two    |
| docs[2]        | 63251  |
| hits[2]        | 75961  |
+----------------+--------+
13 rows in set (0.00 sec)
[
  {
    "columns": [
      {
        "id": {
          "type": "long long"
        }
      },
      {
        "story_author": {
          "type": "string"
        }
      }
    ],
    "data": [
      {
        "id": 300263,
        "story_author": "throwaway37"
      },
      {
        "id": 713503,
        "story_author": "mahmud"
      },
      {
        "id": 716804,
        "story_author": "mahmud"
      },
      {
        "id": 776906,
        "story_author": "jimbokun"
      },
      {
        "id": 753332,
        "story_author": "foxhop"
      }
    ],
    "total": 5,
    "error": "",
    "warning": ""
  },
  {
    "columns": [
      {
        "Variable_name": {
          "type": "string"
        }
      },
      {
        "Value": {
          "type": "string"
        }
      }
    ],
    "data": [
      {
        "Variable_name": "total",
        "Value": "5"
      },
      {
        "Variable_name": "total_found",
        "Value": "266385"
      },
      {
        "Variable_name": "total_relation",
        "Value": "eq"
      },
      {
        "Variable_name": "time",
        "Value": "0.011"
      },
      {
        "Variable_name": "keyword[0]",
        "Value": "one"
      },
      {
        "Variable_name": "docs[0]",
        "Value": "224387"
      },
      {
        "Variable_name": "hits[0]",
        "Value": "310327"
      },
      {
        "Variable_name": "keyword[1]",
        "Value": "three"
      },
      {
        "Variable_name": "docs[1]",
        "Value": "18181"
      },
      {
        "Variable_name": "hits[1]",
        "Value": "21102"
      },
      {
        "Variable_name": "keyword[2]",
        "Value": "two"
      },
      {
        "Variable_name": "docs[2]",
        "Value": "63251"
      },
      {
        "Variable_name": "hits[2]",
        "Value": "75961"
      }
    ],
    "total": 13,
    "error": "",
    "warning": ""
  }
]

You can also use the optional LIKE clause, which allows you to select only the variables that match a specific pattern. The pattern syntax follows standard SQL wildcards, where % represents any number of any characters, and _ represents a single character.

‹›

  • SQL
  • JSON

SQL JSON

📋

⚙

SHOW META LIKE 'total%';
POST /sql?mode=raw -d "SHOW META LIKE 'total%'"

‹›

Response

+----------------+--------+
| Variable_name  | Value  |
+----------------+--------+
| total          | 5      |
| total_found    | 266385 |
| total_relation | eq     |
+----------------+--------+
3 rows in set (0.00 sec)
[
  {
    "columns": [
      {
        "Variable_name": {
          "type": "string"
        }
      },
      {
        "Value": {
          "type": "string"
        }
      }
    ],
    "data": [
      {
        "Variable_name": "total",
        "Value": "5"
      },
      {
        "Variable_name": "total_found",
        "Value": "266385"
      },
      {
        "Variable_name": "total_relation",
        "Value": "eq"
      }
    ],
    "total": 3,
    "error": "",
    "warning": ""
  }
]

SHOW META and facets

When utilizing faceted search, you can examine the multiplier field in the SHOW META output to determine how many queries were executed in an optimized group.

‹›

  • SQL
  • JSON

SQL JSON

📋

⚙

SELECT * FROM facetdemo FACET brand_id FACET price FACET categories;
SHOW META LIKE 'multiplier';
POST /sql?mode=raw -d "SELECT brand_name FROM facetdemo FACET brand_id FACET price FACET categories; SHOW META LIKE 'multiplier'"

‹›

Response

+------+-------+----------+---------------------+-------------+-------------+---------------------------------------+------------+
| id   | price | brand_id | title               | brand_name  | property    | j                                     | categories |
+------+-------+----------+---------------------+-------------+-------------+---------------------------------------+------------+
|    1 |   306 |        1 | Product Ten Three   | Brand One   | Six_Ten     | {"prop1":66,"prop2":91,"prop3":"One"} | 10,11      |
...
+----------+----------+
| brand_id | count(*) |
+----------+----------+
|        1 |     1013 |
...
+-------+----------+
| price | count(*) |
+-------+----------+
|   306 |        7 |
...
+------------+----------+
| categories | count(*) |
+------------+----------+
|         10 |     2436 |
...
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| multiplier    | 4     |
+---------------+-------+
1 row in set (0.00 sec)
[
  {
    "columns": [
      {
        "brand_name": {
          "type": "string"
        }
      }
    ],
    "data": [
      {
        "brand_name": "Brand One"
      }
      ...
    ],
    "total": 1013,
    "error": "",
    "warning": ""
  },
  {
    "columns": [
      {
        "brand_id": {
          "type": "long long"
        }
      },
      {
        "count(*)": {
          "type": "long long"
        }
      }
    ],
    "data": [
      {
        "brand_id": 1,
        "count(*)": 1013
      }
      ...
    ],
    "total": 1013,
    "error": "",
    "warning": ""
  },
  {
    "columns": [
      {
        "price": {
          "type": "long"
        }
      },
      {
        "count(*)": {
          "type": "long long"
        }
      }
    ],
    "data": [
      {
        "price": 1,
        "count(*)": 7
      }
      ...
    ],
    "total": 658,
    "error": "",
    "warning": ""
  },
  {
    "columns": [
      {
        "categories": {
          "type": "long"
        }
      },
      {
        "count(*)": {
          "type": "long long"
        }
      }
    ],
    "data": [
      {
        "categories": 10,
        "count(*)": 2436
      }
      ...
    ],
    "total": 15,
    "error": "",
    "warning": ""
  },
  {
    "columns": [
      {
        "Variable_name": {
          "type": "string"
        }
      },
      {
        "Value": {
          "type": "string"
        }
      }
    ],
    "data": [
      {
        "Variable_name": "multiplier",
        "Value": "4"
      }
    ],
    "total": 1,
    "error": "",
    "warning": ""
  }
]

SHOW META and query optimizer

When the cost-based query optimizer chooses to use DocidIndex, ColumnarScan, or SecondaryIndex instead of a plain filter, this is reflected in the SHOW META command.

The index variable displays the names and types of secondary indexes used during query execution. The percentage indicates how many disk chunks (in the case of an RT table) or pseudo shards (in the case of a plain table) utilized the secondary index.

‹›

  • SQL
  • JSON

SQL JSON

📋

⚙

SELECT count(*) FROM taxi1 WHERE tip_amount = 5;
SHOW META;
POST /sql?mode=raw -d "SELECT count(*) FROM taxi1 WHERE tip_amount = 5; SHOW META"

‹›

Response

+----------------+----------------------------------+
| Variable_name  | Value                            |
+----------------+----------------------------------+
| total          | 1                                |
| total_found    | 1                                |
| total_relation | eq                               |
| time           | 0.016                            |
| index          | tip_amount:SecondaryIndex (100%) |
+----------------+----------------------------------+
5 rows in set (0.00 sec)
[
  {
    "columns": [
      {
        "count(*)": {
          "type": "long long"
        }
      }
    ],
    "data": [
      {
        "count(*)": 1
      }
    ],
    "total": 1,
    "error": "",
    "warning": ""
  },
  {
    "columns": [
      {
        "Variable_name": {
          "type": "string"
        }
      },
      {
        "Value": {
          "type": "string"
        }
      }
    ],
    "data": [
      {
        "Variable_name": "total",
        "Value": "1"
      },
      {
        "Variable_name": "total_found",
        "Value": "1"
      },
      {
        "Variable_name": "total_relation",
        "Value": "eq"
      },
      {
        "Variable_name": "time",
        "Value": "0.016"
      },
      {
        "Variable_name": "index",
        "Value": "tip_amount:SecondaryIndex (100%)"
      }
    ],
    "total": 5,
    "error": "",
    "warning": ""
  }
]

SHOW META for PQ tables

SHOW META can be used after executing a CALL PQ statement, in which case it provides different output.

SHOW META following a CALL PQ statement includes:

  • total - Total time spent on matching the document(s)
  • queries_matched - Number of stored queries that match the document(s)
  • document_matches - Number of documents that matched the queries stored in the table
  • total_queries_stored - Total number of queries stored in the table
  • term_only_queries - Number of queries in the table that have terms; the remaining queries use extended query syntax.

‹›

  • SQL

SQL

📋

⚙

CALL PQ ('pq', ('{"title":"angry", "gid":3 }')); SHOW META;

‹›

Response

+------+
| id   |
+------+
|    2 |
+------+
1 row in set (0.00 sec)
+-----------------------+-----------+
| Variable name         | Value     |
+-----------------------+-----------+
| total                 | 0.000 sec |
| queries_matched       | 1         |
| queries_failed        | 0         |
| document_matched      | 1         |
| total_queries_stored  | 2         |
| term_only_queries     | 2         |
| fast_rejected_queries | 1         |
+-----------------------+-----------+
7 rows in set (0.00 sec)

Using CALL PQ with a verbose option provides more detailed output.

It includes the following additional entries:

  • Setup - Time spent on the initial setup of the matching process, such as parsing docs and setting options
  • Queries failed - Number of queries that failed
  • Fast rejected queries - Number of queries that were not fully evaluated but quickly matched and rejected using filters or other conditions
  • Time per query - Detailed time for each query
  • Time of matched queries - Total time spent on queries that matched any documents

‹›

  • SQL

SQL

📋

⚙

CALL PQ ('pq', ('{"title":"angry", "gid":3 }'), 1 as verbose); SHOW META;

‹›

Response

+------+
| id   |
+------+
|    2 |
+------+
1 row in set (0.00 sec)
+-------------------------+-----------+
| Variable name           | Value     |
+-------------------------+-----------+
| total                   | 0.000 sec |
| setup                   | 0.000 sec |
| queries_matched         | 1         |
| queries_failed          | 0         |
| document_matched        | 1         |
| total_queries_stored    | 2         |
| term_only_queries       | 2         |
| fast_rejected_queries   | 1         |
| time_per_query          | 69        |
| time_of_matched_queries | 69        |
+-------------------------+-----------+
10 rows in set (0.00 sec)

Last modified: April 13, 2026

SHOW THREADS

SHOW THREADS [ OPTION columns=width[,format=sphinxql][,format=all] ]

SHOW THREADS is an SQL statement that displays information about all threads and their current activities.

The resulting table contains the following columns:

  • TID: ID assigned to the thread by the kernel
  • Name: Thread name, also visible in top, htop, ps, and other process-viewing tools
  • Proto: Connection protocol; possible values include sphinx, mysql, http, ssl, compressed, replication, or a combination (e.g., http,ssl or compressed,mysql)
  • State: Thread state; possible values are handshake, net_read, net_write, query, net_idle
  • Connection from: Client's ip:port
  • ConnID: Connection ID (starting from 0)
  • This/prev job time: When the thread is busy - how long the current job has been running; when the thread is idling - previous job duration + suffix prev
  • Jobs done: Number of jobs completed by this thread
  • Thread status: idling or working
  • Info: Information about the query, which may include multiple queries if the query targets a distributed table or a real-time table

‹›

  • SQL
  • JSON
  • PHP
  • Python
  • Python-asyncio
  • javascript
  • Java
  • C#
  • Rust
  • TypeScript
  • Go

SQL JSON PHP Python Python-asyncio javascript Java C# Rust TypeScript Go

📋

⚙

SHOW THREADS;
POST /cli -d "SHOW THREADS"
require_once __DIR__ . '/vendor/autoload.php';
$config = ['host'=>'127.0.0.1','port'=>9308];
$client = new \Manticoresearch\Client($config);
print_r($client->nodes()->threads());
import manticoresearch
config = manticoresearch.Configuration(
            host = "http://127.0.0.1:9308"
            )
client = manticoresearch.ApiClient(config)
utilsApi = manticoresearch.UtilsApi(client)
print(utilsApi.sql('SHOW THREADS'))
import manticoresearch
config = manticoresearch.Configuration(
            host = "http://127.0.0.1:9308"
            )
client = manticoresearch.ApiClient(config)
utilsApi = manticoresearch.UtilsApi(client)
res = await utilsApi.sql('SHOW THREADS')
print(res)
var Manticoresearch = require('manticoresearch');
var utilsApi = new Manticoresearch.UtilsApi();
async function showThreads() {
    res = await utilsApi.sql('SHOW THREADS');
    console.log(JSON.stringify(res, null, 4));
}
showThreads();
utilsApi.sql("SHOW THREADS");
utilsApi.Sql("SHOW THREADS");
utils_api.sql("SHOW THREADS", Some(true)).await;
res = await utilsApi.sql('SHOW THREADS');
apiClient.UtilsAPI.Sql(context.Background()).Body("SHOW THREADS").Execute()

‹›

Response

*************************** 1. row ***************************
                TID: 83
               Name: work_1
              Proto: mysql
              State: query
    Connection from: 172.17.0.1:43300
             ConnID: 8
 This/prev job time: 630us
       CPU activity: 94%
          Jobs done: 2490
      Thread status: working
               Info: SHOW THREADS
*************************** 2. row ***************************
                TID: 84
               Name: work_2
              Proto: mysql
              State: query
    Connection from: 172.17.0.1:43301
             ConnID: 9
 This/prev job time: 689us
       CPU activity: 89%
          Jobs done: 1830
      Thread status: working
               Info: show threads
+--------+---------+-------+-------+-----------------+--------+-----------------------+-----------+---------------+--------------+
| TID    | Name    | Proto | State | Connection from | ConnID | This/prev job time, s | Jobs done | Thread status | Info         |
+--------+---------+-------+-------+-----------------+--------+-----------------------+-----------+---------------+--------------+
| 501494 | work_23 | http  | query | 127.0.0.1:41300 | 1473   | 249us                 | 1681      | working       | show_threads |
+--------+---------+-------+-------+-----------------+--------+-----------------------+-----------+---------------+--------------+
Array
(
    [0] => Array
        (
            [TID] => 506960
            [Name] => work_8
            [Proto] => http
            [State] => query
            [Connection from] => 127.0.0.1:38072
            [ConnID] => 17
            [This/prev job time, s] => 231us
            [CPU activity] => 94%
            [Jobs done] => 8
            [Thread status] => working
            [Info] => show_threads
        )
)
[{'columns': [{'TID': {'type': 'long'}}, {'Name': {'type': 'string'}}, {'Proto': {'type': 'string'}}, {'State': {'type': 'string'}}, {'Connection from': {'type': 'string'}}, {'ConnID': {'type': 'long long'}}, {'This/prev job time, s': {'type': 'string'}}, {'CPU activity': {'type': 'string'}}, {'Jobs done': {'type': 'long'}}, {'Thread status': {'type': 'string'}}, {'Info': {'type': 'string'}}], 'data': [{'TID': 506958, 'Name': 'work_6', 'Proto': 'http', 'State': 'query', 'Connection from': '127.0.0.1:38600', 'ConnID': 834, 'This/prev job time, s': '206us', 'CPU activity': '92%', 'Jobs done': 943, 'Thread status': 'working', 'Info': 'show_threads'}], 'total': 1, 'error': '', 'warning': ''}]
[{'columns': [{'TID': {'type': 'long'}}, {'Name': {'type': 'string'}}, {'Proto': {'type': 'string'}}, {'State': {'type': 'string'}}, {'Connection from': {'type': 'string'}}, {'ConnID': {'type': 'long long'}}, {'This/prev job time, s': {'type': 'string'}}, {'CPU activity': {'type': 'string'}}, {'Jobs done': {'type': 'long'}}, {'Thread status': {'type': 'string'}}, {'Info': {'type': 'string'}}], 'data': [{'TID': 506958, 'Name': 'work_6', 'Proto': 'http', 'State': 'query', 'Connection from': '127.0.0.1:38600', 'ConnID': 834, 'This/prev job time, s': '206us', 'CPU activity': '92%', 'Jobs done': 943, 'Thread status': 'working', 'Info': 'show_threads'}], 'total': 1, 'error': '', 'warning': ''}]
[
    {
        "columns": [
            {
                "TID": {
                    "type": "long"
                }
            },
            {
                "Name": {
                    "type": "string"
                }
            },
            {
                "Proto": {
                    "type": "string"
                }
            },
            {
                "State": {
                    "type": "string"
                }
            },
            {
                "Connection from": {
                    "type": "string"
                }
            },
            {
                "ConnID": {
                    "type": "long long"
                }
            },
            {
                "This/prev job time, s": {
                    "type": "string"
                }
            },
            {
                "CPU activity": {
                    "type": "string"
                }
            },
            {
                "Jobs done": {
                    "type": "long"
                }
            },
            {
                "Thread status": {
                    "type": "string"
                }
            },
            {
                "Info": {
                    "type": "string"
                }
            }
        ],
        "data": [
            {
                "TID": 506964,
                "Name": "work_12",
                "Proto": "http",
                "State": "query",
                "Connection from": "127.0.0.1:36656",
                "ConnID": 2884,
                "This/prev job time, s": "236us",
                "CPU activity": "92%",
                "Jobs done": 3328,
                "Thread status": "working",
                "Info": "show_threads"
            }
        ],
        "total": 1,
        "error": "",
        "warning": ""
    }
]
{
  columns=[
    {
      TID={
        type=string
      }
    },
    {
      Name={
        type=string
      }
    },
    {
      Proto={
        type=string
      }
    },
    {
      State={
        type=string
      }
    },
    {
      Connection from={
        type=string
      }
    },
    {
      ConnID={
        type=string
      }
    },
    {
      This/prev job time={
        type=string
      }
    },
    {
      CPU activity={
        type=string
      }
    },
    {
      Jobs done={
        type=string
      }
    },
    {
      Thread status={
        type=string
      }
    },
    {
      Info={
        type=string
      }
    }
  ],
  data=[
    {
      TID=82,
      Name=work_0,
      Proto=http,
      State=query,
      Connection from=172.17.0.1:60550,
      ConnID=163,
      This/prev job time=105us,
      CPU activity=45%,
      Jobs done=849,
      Thread status=working,
      Info=show_threads
    }
  ],
  total=0,
  error=,
  warning=
}
{
  columns=[
    {
      TID={
        type=string
      }
    },
    {
      Name={
        type=string
      }
    },
    {
      Proto={
        type=string
      }
    },
    {
      State={
        type=string
      }
    },
    {
      Connection from={
        type=string
      }
    },
    {
      ConnID={
        type=string
      }
    },
    {
      This/prev job time= {
        type=string
      }
    },
    {
      Jobs done={
        type=string
      }
    },
    {
      Thread status={
        type=string
      }
    },
    {
      Info={
        type=string
      }
    }
  ],
  data=[
    {
      TID=83,
      Name=work_1,
      Proto=http,
      State=query,
      Connection from=172.17.0.1:41410,
      ConnID=6,
      This/prev job time=689us,
      Jobs done=159,
      Thread status=working,
      Info=show_threads
    }
  ],
  total=0,
  error="",
  warning=""
}
{
  columns=[
    {
      TID={
        type=string
      }
    },
    {
      Name={
        type=string
      }
    },
    {
      Proto={
        type=string
      }
    },
    {
      State={
        type=string
      }
    },
    {
      Connection from={
        type=string
      }
    },
    {
      ConnID={
        type=string
      }
    },
    {
      This/prev job time= {
        type=string
      }
    },
    {
      Jobs done={
        type=string
      }
    },
    {
      Thread status={
        type=string
      }
    },
    {
      Info={
        type=string
      }
    }
  ],
  data=[
    {
      TID=83,
      Name=work_1,
      Proto=http,
      State=query,
      Connection from=172.17.0.1:41410,
      ConnID=6,
      This/prev job time=689us,
      Jobs done=159,
      Thread status=working,
      Info=show_threads
    }
  ],
  total=0,
  error="",
  warning=""
}
[
    {
        "columns": [
            {
                "TID": {
                    "type": "long"
                }
            },
            {
                "Name": {
                    "type": "string"
                }
            },
            {
                "Proto": {
                    "type": "string"
                }
            },
            {
                "State": {
                    "type": "string"
                }
            },
            {
                "Connection from": {
                    "type": "string"
                }
            },
            {
                "ConnID": {
                    "type": "long long"
                }
            },
            {
                "This/prev job time, s": {
                    "type": "string"
                }
            },
            {
                "CPU activity": {
                    "type": "string"
                }
            },
            {
                "Jobs done": {
                    "type": "long"
                }
            },
            {
                "Thread status": {
                    "type": "string"
                }
            },
            {
                "Info": {
                    "type": "string"
                }
            }
        ],
        "data": [
            {
                "TID": 506964,
                "Name": "work_12",
                "Proto": "http",
                "State": "query",
                "Connection from": "127.0.0.1:36656",
                "ConnID": 2884,
                "This/prev job time, s": "236us",
                "CPU activity": "92%",
                "Jobs done": 3328,
                "Thread status": "working",
                "Info": "show_threads"
            }
        ],
        "total": 1,
        "error": "",
        "warning": ""
    }
]
[
    {
        "columns": [
            {
                "TID": {
                    "type": "long"
                }
            },
            {
                "Name": {
                    "type": "string"
                }
            },
            {
                "Proto": {
                    "type": "string"
                }
            },
            {
                "State": {
                    "type": "string"
                }
            },
            {
                "Connection from": {
                    "type": "string"
                }
            },
            {
                "ConnID": {
                    "type": "long long"
                }
            },
            {
                "This/prev job time, s": {
                    "type": "string"
                }
            },
            {
                "CPU activity": {
                    "type": "string"
                }
            },
            {
                "Jobs done": {
                    "type": "long"
                }
            },
            {
                "Thread status": {
                    "type": "string"
                }
            },
            {
                "Info": {
                    "type": "string"
                }
            }
        ],
        "data": [
            {
                "TID": 506964,
                "Name": "work_12",
                "Proto": "http",
                "State": "query",
                "Connection from": "127.0.0.1:36656",
                "ConnID": 2884,
                "This/prev job time, s": "236us",
                "CPU activity": "92%",
                "Jobs done": 3328,
                "Thread status": "working",
                "Info": "show_threads"
            }
        ],
        "total": 1,
        "error": "",
        "warning": ""
    }
]

The Info column displays:

  • Raw text of queries executed via the Manticore SQL interface
  • Full text syntax, comments, and data size for queries run through the internal Manticore binary protocol (e.g., from a remote Manticore instance)

You can limit the maximum width of the Info column by specifying the columns=N option.

By default, queries are displayed in their original format. However, when the format=sphinxql option is used, queries will be shown in SQL format, regardless of the protocol used for execution.

Using format=all will show all threads, while idling and system threads are hidden without this option (e.g., those busy with OPTIMIZE).

‹›

  • SQL
  • JSON
  • PHP
  • Python
  • Python-asyncio
  • javascript
  • Java
  • C#
  • Rust
  • TypeScript
  • Go

SQL JSON PHP Python Python-asyncio javascript Java C# Rust TypeScript Go

📋

⚙

SHOW THREADS OPTION columns=30\G
POST /cli -d "SHOW THREADS OPTION columns=30"
$client->nodes()->threads(['body'=>['columns'=>30]]);
utilsApi.sql('SHOW THREADS OPTION columns=30')
await utilsApi.sql('SHOW THREADS OPTION columns=30')
res = await utilsApi.sql('SHOW THREADS OPTION columns=30');
utilsApi.sql("SHOW THREADS OPTION columns=30");
utilsApi.Sql("SHOW THREADS OPTION columns=30");
utils_api.sql("SHOW THREADS OPTION columns=30", Some(true)).await;
res = await utilsApi.sql('SHOW THREADS OPTION columns=30');
apiClient.UtilsAPI.Sql(context.Background()).Body("SHOW THREADS OPTION columns=30").Execute()

Last modified: August 28, 2025

SHOW QUERIES

SHOW QUERIES

NOTE: SHOW QUERIES requires Manticore Buddy. If it doesn't work, make sure Buddy is installed.

SHOW QUERIES returns information about all currently running queries. The output is a table with the following structure:

  • id: Query ID that can be used in KILL to terminate the query
  • query: Query statement or a portion of it
  • time: Time taken on command execution or how long ago the query was performed (in this case, the value will include ago)
  • protocol: Connection protocol, with possible values being sphinx, mysql, http, ssl, compressed, replication, or a combination (e.g., http,ssl or compressed,mysql)
  • host: Client's ip:port

‹›

  • SQL
  • JSON

SQL JSON

📋

⚙

mysql> SHOW QUERIES;
POST /sql?mode=raw -d "SHOW QUERIES"

‹›

Response

+------+--------------+---------+----------+-----------------+
| id   | query        | time    | protocol | host            |
+------+--------------+---------+----------+-----------------+
|  111 | select       | 5ms ago | http     | 127.0.0.1:58986 |
|   96 | SHOW QUERIES | 255us   | mysql    | 127.0.0.1:33616 |
+------+--------------+---------+----------+-----------------+
2 rows in set (0.61 sec)

``` [ { "total": 2, "error": "", "warning": "", "columns": [ { "id": { "type": "long long" } }, { "query": { "type": "string" } }, { "time": { "type": "string" } }, { "protocol": { "type": "string" } }, { "host": { "type": "string" } } ], "data": [ { "id": 111, "query": "select", "time": "5ms ago", "protocol": "http", "host": "127.0.0.1:58986" }, { "id": 96, "query": "SHOW QUERIES", "time

(本文超出站点单文档体积上限,已截断)