The easiest way to view high-level information about your Manticore node is by running status
in the MySQL client. It will display information about various aspects, such as:
clients
)mysql> status
--------------
mysql Ver 14.14 Distrib 5.7.30, for Linux (x86_64) using EditLine wrapper
Connection id: 378
Current database: Manticore
Current user: Usual
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 3.4.3 a48c61d6@200702 coroutines git branch coroutines_work_junk...origin/coroutines_work_junk
Protocol version: 10
Connection: 0 via TCP/IP
Server characterset:
Db characterset:
Client characterset: utf8
Conn. characterset: utf8
TCP port: 8306
Uptime: 23 hours 6 sec
Threads: 12 Queue: 3 Clients: 1 Vip clients: 0 Tasks: 5 Queries: 318967 Wall: 7h CPU: 0us
Queue/Th: 0.2 Tasks/Th: 0.4
--------------
SHOW STATUS [ LIKE pattern ]
SHOW STATUS
is an SQL statement that presents various helpful performance counters. IO and CPU counters will only be available if searchd
was started with the --iostats
and --cpustats
switches, respectively (or if they were enabled via SET GLOBAL iostats/cpustats=1
).
SHOW STATUS;
+-----------------------+---------------------------+
| Counter | Value |
+-----------------------+---------------------------+
| uptime | 1385 |
| connections | 11 |
| maxed_out | 0 |
| version | 3.4.3 ab7cbe5d@200511 dev |
| mysql_version | 3.4.3 ab7cbe5d@200511 dev |
| command_search | 2 |
| command_excerpt | 0 |
| command_update | 0 |
| command_delete | 0 |
| command_keywords | 0 |
| command_persist | 0 |
| command_status | 1 |
| command_flushattrs | 0 |
| command_set | 1 |
| command_insert | 0 |
| command_replace | 0 |
| command_commit | 0 |
| command_suggest | 0 |
| command_json | 0 |
| command_callpq | 0 |
| agent_connect | 0 |
| agent_retry | 0 |
| queries | 12 |
| dist_queries | 0 |
| workers_total | 30 |
| workers_active | 1 |
| workers_clients | 0 |
| workers_clients_vip | 1 |
| work_queue_length | 1 |
| query_wall | 10.805 |
| query_cpu | OFF |
| dist_wall | 0.000 |
| dist_local | 0.000 |
| dist_wait | 0.000 |
| query_reads | OFF |
| query_readkb | OFF |
| query_readtime | OFF |
| avg_query_wall | 0.900 |
| avg_query_cpu | OFF |
| avg_dist_wall | 0.000 |
| avg_dist_local | 0.000 |
| avg_dist_wait | 0.000 |
| avg_query_reads | OFF |
| avg_query_readkb | OFF |
| avg_query_readtime | OFF |
| qcache_max_bytes | 0 |
| qcache_thresh_msec | 3000 |
| qcache_ttl_sec | 60 |
| qcache_cached_queries | 0 |
| qcache_used_bytes | 0 |
| qcache_hits | 0 |
+-----------------------+---------------------------+
49 rows in set (0.00 sec)
An optional LIKE
clause is supported, allowing 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.
SHOW STATUS LIKE 'qcache%';
+-----------------------+-------+
| Counter | Value |
+-----------------------+-------+
| qcache_max_bytes | 0 |
| qcache_thresh_msec | 3000 |
| qcache_ttl_sec | 60 |
| qcache_cached_queries | 0 |
| qcache_used_bytes | 0 |
| qcache_hits | 0 |
+-----------------------+-------+
6 rows in set (0.00 sec)
SHOW SETTINGS
is an SQL statement that displays the current settings from your configuration file. The setting names are represented in the following format: 'config_section_name'.'setting_name'
The result also includes two additional values:
- configuration_file
- The path to the configuration file
- worker_pid
- The process ID of the running searchd
instance
SHOW SETTINGS;
+--------------------------+-------------------------------------+
| Setting_name | Value |
+--------------------------+-------------------------------------+
| configuration_file | /etc/manticoresearch/manticore.conf |
| worker_pid | 658 |
| searchd.listen | 0.0.0:9312 |
| searchd.listen | 0.0.0:9306:mysql |
| searchd.listen | 0.0.0:9308:http |
| searchd.log | /var/log/manticore/searchd.log |
| searchd.query_log | /var/log/manticore/query.log |
| searchd.pid_file | /var/run/manticore/searchd.pid |
| searchd.data_dir | /var/lib/manticore |
| searchd.query_log_format | sphinxql |
| searchd.binlog_path | /var/lib/manticore/binlog |
| common.plugin_dir | /usr/local/lib/manticore |
| common.lemmatizer_base | /usr/share/manticore/morph/ |
+--------------------------+-------------------------------------+
13 rows in set (0.00 sec)
SHOW AGENT ['agent_or_index'] STATUS [ LIKE pattern ]
SHOW AGENT STATUS
displays the statistics of remote agents or a distributed table. It includes values such as the age of the last request, last answer, the number of various types of errors and successes, and so on. Statistics are displayed for every agent for the last 1, 5, and 15 intervals, each consisting of ha_period_karma seconds.
SHOW AGENT STATUS;
+------------------------------------+----------------------------+
| Variable_name | Value |
+------------------------------------+----------------------------+
| status_period_seconds | 60 |
| status_stored_periods | 15 |
| ag_0_hostname | 192.168.0.202:6713 |
| ag_0_references | 2 |
| ag_0_lastquery | 0.41 |
| ag_0_lastanswer | 0.19 |
| ag_0_lastperiodmsec | 222 |
| ag_0_pingtripmsec | 10.521 |
| ag_0_errorsarow | 0 |
| ag_0_1periods_query_timeouts | 0 |
| ag_0_1periods_connect_timeouts | 0 |
| ag_0_1periods_connect_failures | 0 |
| ag_0_1periods_network_errors | 0 |
| ag_0_1periods_wrong_replies | 0 |
| ag_0_1periods_unexpected_closings | 0 |
| ag_0_1periods_warnings | 0 |
| ag_0_1periods_succeeded_queries | 27 |
| ag_0_1periods_msecsperquery | 232.31 |
| ag_0_5periods_query_timeouts | 0 |
| ag_0_5periods_connect_timeouts | 0 |
| ag_0_5periods_connect_failures | 0 |
| ag_0_5periods_network_errors | 0 |
| ag_0_5periods_wrong_replies | 0 |
| ag_0_5periods_unexpected_closings | 0 |
| ag_0_5periods_warnings | 0 |
| ag_0_5periods_succeeded_queries | 146 |
| ag_0_5periods_msecsperquery | 231.83 |
| ag_1_hostname | 192.168.0.202:6714 |
| ag_1_references | 2 |
| ag_1_lastquery | 0.41 |
| ag_1_lastanswer | 0.19 |
| ag_1_lastperiodmsec | 220 |
| ag_1_pingtripmsec | 10.004 |
| ag_1_errorsarow | 0 |
| ag_1_1periods_query_timeouts | 0 |
| ag_1_1periods_connect_timeouts | 0 |
| ag_1_1periods_connect_failures | 0 |
| ag_1_1periods_network_errors | 0 |
| ag_1_1periods_wrong_replies | 0 |
| ag_1_1periods_unexpected_closings | 0 |
| ag_1_1periods_warnings | 0 |
| ag_1_1periods_succeeded_queries | 27 |
| ag_1_1periods_msecsperquery | 231.24 |
| ag_1_5periods_query_timeouts | 0 |
| ag_1_5periods_connect_timeouts | 0 |
| ag_1_5periods_connect_failures | 0 |
| ag_1_5periods_network_errors | 0 |
| ag_1_5periods_wrong_replies | 0 |
| ag_1_5periods_unexpected_closings | 0 |
| ag_1_5periods_warnings | 0 |
| ag_1_5periods_succeeded_queries | 146 |
| ag_1_5periods_msecsperquery | 230.85 |
+------------------------------------+----------------------------+
50 rows in set (0.01 sec)
$client->nodes()->agentstatus();
Array(
[status_period_seconds] => 60
[status_stored_periods] => 15
[ag_0_hostname] => 192.168.0.202:6713
[ag_0_references] => 2
[ag_0_lastquery] => 0.41
[ag_0_lastanswer] => 0.19
[ag_0_lastperiodmsec] => 222
[ag_0_errorsarow] => 0
[ag_0_1periods_query_timeouts] => 0
[ag_0_1periods_connect_timeouts] => 0
[ag_0_1periods_connect_failures] => 0
[ag_0_1periods_network_errors] => 0
[ag_0_1periods_wrong_replies] => 0
[ag_0_1periods_unexpected_closings] => 0
[ag_0_1periods_warnings] => 0
[ag_0_1periods_succeeded_queries] => 27
[ag_0_1periods_msecsperquery] => 232.31
[ag_0_5periods_query_timeouts] => 0
[ag_0_5periods_connect_timeouts] => 0
[ag_0_5periods_connect_failures] => 0
[ag_0_5periods_network_errors] => 0
[ag_0_5periods_wrong_replies] => 0
[ag_0_5periods_unexpected_closings] => 0
[ag_0_5periods_warnings] => 0
[ag_0_5periods_succeeded_queries] => 146
[ag_0_5periods_msecsperquery] => 231.83
[ag_1_hostname 192.168.0.202:6714
[ag_1_references] => 2
[ag_1_lastquery] => 0.41
[ag_1_lastanswer] => 0.19
[ag_1_lastperiodmsec] => 220
[ag_1_errorsarow] => 0
[ag_1_1periods_query_timeouts] => 0
[ag_1_1periods_connect_timeouts] => 0
[ag_1_1periods_connect_failures] => 0
[ag_1_1periods_network_errors] => 0
[ag_1_1periods_wrong_replies] => 0
[ag_1_1periods_unexpected_closings] => 0
[ag_1_1periods_warnings] => 0
[ag_1_1periods_succeeded_queries] => 27
[ag_1_1periods_msecsperquery] => 231.24
[ag_1_5periods_query_timeouts] => 0
[ag_1_5periods_connect_timeouts] => 0
[ag_1_5periods_connect_failures] => 0
[ag_1_5periods_network_errors] => 0
[ag_1_5periods_wrong_replies] => 0
[ag_1_5periods_unexpected_closings
[ag_1_5periods_warnings] => 0
[ag_1_5periods_succeeded_queries] => 146
[ag_1_5periods_msecsperquery] => 230.85
)
utilsApi.sql('SHOW AGENT STATUS')
{u'columns': [{u'Key': {u'type': u'string'}},
{u'Value': {u'type': u'string'}}],
u'data': [
{u'Key': u'status_period_seconds', u'Value': u'60'},
{u'Key': u'status_stored_periods', u'Value': u'15'},
{u'Key': u'ag_0_hostname', u'Value': u'192.168.0.202:6713'},
{u'Key': u'ag_0_references', u'Value': u'2'},
{u'Key': u'ag_0_lastquery', u'Value': u'0.41'},
{u'Key': u'ag_0_lastanswer', u'Value': u'0.19'},
{u'Key': u'ag_0_lastperiodmsec', u'Value': u'222'},
{u'Key': u'ag_0_errorsarow', u'Value': u'0'},
{u'Key': u'ag_0_1periods_query_timeouts', u'Value': u'0'},
{u'Key': u'ag_0_1periods_connect_timeouts', u'Value': u'0'},
{u'Key': u'ag_0_1periods_connect_failures', u'Value': u'0'},
{u'Key': u'ag_0_1periods_network_errors', u'Value': u'0'},
{u'Key': u'ag_0_1periods_wrong_replies', u'Value': u'0'},
{u'Key': u'ag_0_1periods_unexpected_closings', u'Value': u'0'},
{u'Key': u'ag_0_1periods_warnings', u'Value': u'0'},
{u'Key': u'ag_0_1periods_succeeded_queries', u'Value': u'27'},
{u'Key': u'ag_0_1periods_msecsperquery', u'Value': u'232.31'},
{u'Key': u'ag_0_5periods_query_timeouts', u'Value': u'0'},
{u'Key': u'ag_0_5periods_connect_timeouts', u'Value': u'0'},
{u'Key': u'ag_0_5periods_connect_failures', u'Value': u'0'},
{u'Key': u'ag_0_5periods_network_errors', u'Value': u'0'},
{u'Key': u'ag_0_5periods_wrong_replies', u'Value': u'0'},
{u'Key': u'ag_0_5periods_unexpected_closings', u'Value': u'0'},
{u'Key': u'ag_0_5periods_warnings', u'Value': u'0'},
{u'Key': u'ag_0_5periods_succeeded_queries', u'Value': u'146'},
{u'Key': u'ag_0_5periods_msecsperquery', u'Value': u'231.83'},
{u'Key': u'ag_1_hostname 192.168.0.202:6714'},
{u'Key': u'ag_1_references', u'Value': u'2'},
{u'Key': u'ag_1_lastquery', u'Value': u'0.41'},
{u'Key': u'ag_1_lastanswer', u'Value': u'0.19'},
{u'Key': u'ag_1_lastperiodmsec', u'Value': u'220'},
{u'Key': u'ag_1_errorsarow', u'Value': u'0'},
{u'Key': u'ag_1_1periods_query_timeouts', u'Value': u'0'},
{u'Key': u'ag_1_1periods_connect_timeouts', u'Value': u'0'},
{u'Key': u'ag_1_1periods_connect_failures', u'Value': u'0'},
{u'Key': u'ag_1_1periods_network_errors', u'Value': u'0'},
{u'Key': u'ag_1_1periods_wrong_replies', u'Value': u'0'},
{u'Key': u'ag_1_1periods_unexpected_closings', u'Value': u'0'},
{u'Key': u'ag_1_1periods_warnings', u'Value': u'0'},
{u'Key': u'ag_1_1periods_succeeded_queries', u'Value': u'27'},
{u'Key': u'ag_1_1periods_msecsperquery', u'Value': u'231.24'},
{u'Key': u'ag_1_5periods_query_timeouts', u'Value': u'0'},
{u'Key': u'ag_1_5periods_connect_timeouts', u'Value': u'0'},
{u'Key': u'ag_1_5periods_connect_failures', u'Value': u'0'},
{u'Key': u'ag_1_5periods_network_errors', u'Value': u'0'},
{u'Key': u'ag_1_5periods_wrong_replies', u'Value': u'0'},
{u'Key': u'ag_1_5periods_warnings', u'Value': u'0'},
{u'Key': u'ag_1_5periods_succeeded_queries', u'Value': u'146'},
{u'Key': u'ag_1_5periods_msecsperquery', u'Value': u'230.85'}],
u'error': u'',
u'total': 0,
u'warning': u''}
res = await utilsApi.sql("SHOW AGENT STATUS");
{"columns": [{"Key": {"type": "string"}},
{"Value": {"type": "string"}}],
"data": [
{"Key": "status_period_seconds", "Value": "60"},
{"Key": "status_stored_periods", "Value": "15"},
{"Key": "ag_0_hostname", "Value": "192.168.0.202:6713"},
{"Key": "ag_0_references", "Value": "2"},
{"Key": "ag_0_lastquery", "Value": "0.41"},
{"Key": "ag_0_lastanswer", "Value": "0.19"},
{"Key": "ag_0_lastperiodmsec", "Value": "222"},
{"Key": "ag_0_errorsarow", "Value": "0"},
{"Key": "ag_0_1periods_query_timeouts", "Value": "0"},
{"Key": "ag_0_1periods_connect_timeouts", "Value": "0"},
{"Key": "ag_0_1periods_connect_failures", "Value": "0"},
{"Key": "ag_0_1periods_network_errors", "Value": "0"},
{"Key": "ag_0_1periods_wrong_replies", "Value": "0"},
{"Key": "ag_0_1periods_unexpected_closings", "Value": "0"},
{"Key": "ag_0_1periods_warnings", "Value": "0"},
{"Key": "ag_0_1periods_succeeded_queries", "Value": "27"},
{"Key": "ag_0_1periods_msecsperquery", "Value": "232.31"},
{"Key": "ag_0_5periods_query_timeouts", "Value": "0"},
{"Key": "ag_0_5periods_connect_timeouts", "Value": "0"},
{"Key": "ag_0_5periods_connect_failures", "Value": "0"},
{"Key": "ag_0_5periods_network_errors", "Value": "0"},
{"Key": "ag_0_5periods_wrong_replies", "Value": "0"},
{"Key": "ag_0_5periods_unexpected_closings", "Value": "0"},
{"Key": "ag_0_5periods_warnings", "Value": "0"},
{"Key": "ag_0_5periods_succeeded_queries", "Value": "146"},
{"Key": "ag_0_5periods_msecsperquery", "Value": "231.83"},
{"Key": "ag_1_hostname 192.168.0.202:6714"},
{"Key": "ag_1_references", "Value": "2"},
{"Key": "ag_1_lastquery", "Value": "0.41"},
{"Key": "ag_1_lastanswer", "Value": "0.19"},
{"Key": "ag_1_lastperiodmsec", "Value": "220"},
{"Key": "ag_1_errorsarow", "Value": "0"},
{"Key": "ag_1_1periods_query_timeouts", "Value": "0"},
{"Key": "ag_1_1periods_connect_timeouts", "Value": "0"},
{"Key": "ag_1_1periods_connect_failures", "Value": "0"},
{"Key": "ag_1_1periods_network_errors", "Value": "0"},
{"Key": "ag_1_1periods_wrong_replies", "Value": "0"},
{"Key": "ag_1_1periods_unexpected_closings", "Value": "0"},
{"Key": "ag_1_1periods_warnings", "Value": "0"},
{"Key": "ag_1_1periods_succeeded_queries", "Value": "27"},
{"Key": "ag_1_1periods_msecsperquery", "Value": "231.24"},
{"Key": "ag_1_5periods_query_timeouts", "Value": "0"},
{"Key": "ag_1_5periods_connect_timeouts", "Value": "0"},
{"Key": "ag_1_5periods_connect_failures", "Value": "0"},
{"Key": "ag_1_5periods_network_errors", "Value": "0"},
{"Key": "ag_1_5periods_wrong_replies", "Value": "0"},
{"Key": "ag_1_5periods_warnings", "Value": "0"},
{"Key": "ag_1_5periods_succeeded_queries", "Value": "146"},
{"Key": "ag_1_5periods_msecsperquery", "Value": "230.85"}],
"error": "",
"total": 0,
"warning": ""}
utilsApi.sql("SHOW AGENT STATUS");
{columns=[{ Key : { type=string }},
{ Value : { type=string }}],
data : [
{ Key=status_period_seconds , Value=60 },
{ Key=status_stored_periods , Value=15 },
{ Key=ag_0_hostname , Value=192.168.0.202:6713 },
{ Key=ag_0_references , Value=2 },
{ Key=ag_0_lastquery , Value=0.41 },
{ Key=ag_0_lastanswer , Value=0.19 },
{ Key=ag_0_lastperiodmsec , Value=222 },
{ Key=ag_0_errorsarow , Value=0 },
{ Key=ag_0_1periods_query_timeouts , Value=0 },
{ Key=ag_0_1periods_connect_timeouts , Value=0 },
{ Key=ag_0_1periods_connect_failures , Value=0 },
{ Key=ag_0_1periods_network_errors , Value=0 },
{ Key=ag_0_1periods_wrong_replies , Value=0 },
{ Key=ag_0_1periods_unexpected_closings , Value=0 },
{ Key=ag_0_1periods_warnings , Value=0 },
{ Key=ag_0_1periods_succeeded_queries , Value=27 },
{ Key=ag_0_1periods_msecsperquery , Value=232.31 },
{ Key=ag_0_5periods_query_timeouts , Value=0 },
{ Key=ag_0_5periods_connect_timeouts , Value=0 },
{ Key=ag_0_5periods_connect_failures , Value=0 },
{ Key=ag_0_5periods_network_errors , Value=0 },
{ Key=ag_0_5periods_wrong_replies , Value=0 },
{ Key=ag_0_5periods_unexpected_closings , Value=0 },
{ Key=ag_0_5periods_warnings , Value=0 },
{ Key=ag_0_5periods_succeeded_queries , Value=146 },
{ Key=ag_0_5periods_msecsperquery , Value=231.83 },
{ Key=ag_1_hostname 192.168.0.202:6714 },
{ Key=ag_1_references , Value=2 },
{ Key=ag_1_lastquery , Value=0.41 },
{ Key=ag_1_lastanswer , Value=0.19 },
{ Key=ag_1_lastperiodmsec , Value=220 },
{ Key=ag_1_errorsarow , Value=0 },
{ Key=ag_1_1periods_query_timeouts , Value=0 },
{ Key=ag_1_1periods_connect_timeouts , Value=0 },
{ Key=ag_1_1periods_connect_failures , Value=0 },
{ Key=ag_1_1periods_network_errors , Value=0 },
{ Key=ag_1_1periods_wrong_replies , Value=0 },
{ Key=ag_1_1periods_unexpected_closings , Value=0 },
{ Key=ag_1_1periods_warnings , Value=0 },
{ Key=ag_1_1periods_succeeded_queries , Value=27 },
{ Key=ag_1_1periods_msecsperquery , Value=231.24 },
{ Key=ag_1_5periods_query_timeouts , Value=0 },
{ Key=ag_1_5periods_connect_timeouts , Value=0 },
{ Key=ag_1_5periods_connect_failures , Value=0 },
{ Key=ag_1_5periods_network_errors , Value=0 },
{ Key=ag_1_5periods_wrong_replies , Value=0 },
{ Key=ag_1_5periods_warnings , Value=0 },
{ Key=ag_1_5periods_succeeded_queries , Value=146 },
{ Key=ag_1_5periods_msecsperquery , Value=230.85 }],
error= ,
total=0,
warning= }
utilsApi.Sql("SHOW AGENT STATUS");
{columns=[{ Key : { type=string }},
{ Value : { type=string }}],
data : [
{ Key=status_period_seconds , Value=60 },
{ Key=status_stored_periods , Value=15 },
{ Key=ag_0_hostname , Value=192.168.0.202:6713 },
{ Key=ag_0_references , Value=2 },
{ Key=ag_0_lastquery , Value=0.41 },
{ Key=ag_0_lastanswer , Value=0.19 },
{ Key=ag_0_lastperiodmsec , Value=222 },
{ Key=ag_0_errorsarow , Value=0 },
{ Key=ag_0_1periods_query_timeouts , Value=0 },
{ Key=ag_0_1periods_connect_timeouts , Value=0 },
{ Key=ag_0_1periods_connect_failures , Value=0 },
{ Key=ag_0_1periods_network_errors , Value=0 },
{ Key=ag_0_1periods_wrong_replies , Value=0 },
{ Key=ag_0_1periods_unexpected_closings , Value=0 },
{ Key=ag_0_1periods_warnings , Value=0 },
{ Key=ag_0_1periods_succeeded_queries , Value=27 },
{ Key=ag_0_1periods_msecsperquery , Value=232.31 },
{ Key=ag_0_5periods_query_timeouts , Value=0 },
{ Key=ag_0_5periods_connect_timeouts , Value=0 },
{ Key=ag_0_5periods_connect_failures , Value=0 },
{ Key=ag_0_5periods_network_errors , Value=0 },
{ Key=ag_0_5periods_wrong_replies , Value=0 },
{ Key=ag_0_5periods_unexpected_closings , Value=0 },
{ Key=ag_0_5periods_warnings , Value=0 },
{ Key=ag_0_5periods_succeeded_queries , Value=146 },
{ Key=ag_0_5periods_msecsperquery , Value=231.83 },
{ Key=ag_1_hostname 192.168.0.202:6714 },
{ Key=ag_1_references , Value=2 },
{ Key=ag_1_lastquery , Value=0.41 },
{ Key=ag_1_lastanswer , Value=0.19 },
{ Key=ag_1_lastperiodmsec , Value=220 },
{ Key=ag_1_errorsarow , Value=0 },
{ Key=ag_1_1periods_query_timeouts , Value=0 },
{ Key=ag_1_1periods_connect_timeouts , Value=0 },
{ Key=ag_1_1periods_connect_failures , Value=0 },
{ Key=ag_1_1periods_network_errors , Value=0 },
{ Key=ag_1_1periods_wrong_replies , Value=0 },
{ Key=ag_1_1periods_unexpected_closings , Value=0 },
{ Key=ag_1_1periods_warnings , Value=0 },
{ Key=ag_1_1periods_succeeded_queries , Value=27 },
{ Key=ag_1_1periods_msecsperquery , Value=231.24 },
{ Key=ag_1_5periods_query_timeouts , Value=0 },
{ Key=ag_1_5periods_connect_timeouts , Value=0 },
{ Key=ag_1_5periods_connect_failures , Value=0 },
{ Key=ag_1_5periods_network_errors , Value=0 },
{ Key=ag_1_5periods_wrong_replies , Value=0 },
{ Key=ag_1_5periods_warnings , Value=0 },
{ Key=ag_1_5periods_succeeded_queries , Value=146 },
{ Key=ag_1_5periods_msecsperquery , Value=230.85 }],
error="" ,
total=0,
warning="" }
res = await utilsApi.sql("SHOW AGENT STATUS");
{
"columns":
[{
"Key":
{
"type": "string"
}
},
{
"Value":
{
"type": "string"
}
}],
"data":
[
{"Key": "status_period_seconds", "Value": "60"},
{"Key": "status_stored_periods", "Value": "15"},
{"Key": "ag_0_hostname", "Value": "192.168.0.202:6713"},
{"Key": "ag_0_references", "Value": "2"},
{"Key": "ag_0_lastquery", "Value": "0.41"},
{"Key": "ag_0_lastanswer", "Value": "0.19"},
{"Key": "ag_0_lastperiodmsec", "Value": "222"},
{"Key": "ag_0_errorsarow", "Value": "0"},
{"Key": "ag_0_1periods_query_timeouts", "Value": "0"},
{"Key": "ag_0_1periods_connect_timeouts", "Value": "0"},
{"Key": "ag_0_1periods_connect_failures", "Value": "0"},
{"Key": "ag_0_1periods_network_errors", "Value": "0"},
{"Key": "ag_0_1periods_wrong_replies", "Value": "0"},
{"Key": "ag_0_1periods_unexpected_closings", "Value": "0"},
{"Key": "ag_0_1periods_warnings", "Value": "0"},
{"Key": "ag_0_1periods_succeeded_queries", "Value": "27"},
{"Key": "ag_0_1periods_msecsperquery", "Value": "232.31"},
{"Key": "ag_0_5periods_query_timeouts", "Value": "0"},
{"Key": "ag_0_5periods_connect_timeouts", "Value": "0"},
{"Key": "ag_0_5periods_connect_failures", "Value": "0"},
{"Key": "ag_0_5periods_network_errors", "Value": "0"},
{"Key": "ag_0_5periods_wrong_replies", "Value": "0"},
{"Key": "ag_0_5periods_unexpected_closings", "Value": "0"},
{"Key": "ag_0_5periods_warnings", "Value": "0"},
{"Key": "ag_0_5periods_succeeded_queries", "Value": "146"},
{"Key": "ag_0_5periods_msecsperquery", "Value": "231.83"},
{"Key": "ag_1_hostname 192.168.0.202:6714"},
{"Key": "ag_1_references", "Value": "2"},
{"Key": "ag_1_lastquery", "Value": "0.41"},
{"Key": "ag_1_lastanswer", "Value": "0.19"},
{"Key": "ag_1_lastperiodmsec", "Value": "220"},
{"Key": "ag_1_errorsarow", "Value": "0"},
{"Key": "ag_1_1periods_query_timeouts", "Value": "0"},
{"Key": "ag_1_1periods_connect_timeouts", "Value": "0"},
{"Key": "ag_1_1periods_connect_failures", "Value": "0"},
{"Key": "ag_1_1periods_network_errors", "Value": "0"},
{"Key": "ag_1_1periods_wrong_replies", "Value": "0"},
{"Key": "ag_1_1periods_unexpected_closings", "Value": "0"},
{"Key": "ag_1_1periods_warnings", "Value": "0"},
{"Key": "ag_1_1periods_succeeded_queries", "Value": "27"},
{"Key": "ag_1_1periods_msecsperquery", "Value": "231.24"},
{"Key": "ag_1_5periods_query_timeouts", "Value": "0"},
{"Key": "ag_1_5periods_connect_timeouts", "Value": "0"},
{"Key": "ag_1_5periods_connect_failures", "Value": "0"},
{"Key": "ag_1_5periods_network_errors", "Value": "0"},
{"Key": "ag_1_5periods_wrong_replies", "Value": "0"},
{"Key": "ag_1_5periods_warnings", "Value": "0"},
{"Key": "ag_1_5periods_succeeded_queries", "Value": "146"},
{"Key": "ag_1_5periods_msecsperquery", "Value": "230.85"}
],
"error": "",
"total": 0,
"warning": ""
}
res := apiClient.UtilsAPI.Sql(context.Background()).Body("SHOW AGENT STATUS").Execute()
{
"columns":
[{
"Key":
{
"type": "string"
}
},
{
"Value":
{
"type": "string"
}
}],
"data":
[
{"Key": "status_period_seconds", "Value": "60"},
{"Key": "status_stored_periods", "Value": "15"},
{"Key": "ag_0_hostname", "Value": "192.168.0.202:6713"},
{"Key": "ag_0_references", "Value": "2"},
{"Key": "ag_0_lastquery", "Value": "0.41"},
{"Key": "ag_0_lastanswer", "Value": "0.19"},
{"Key": "ag_0_lastperiodmsec", "Value": "222"},
{"Key": "ag_0_errorsarow", "Value": "0"},
{"Key": "ag_0_1periods_query_timeouts", "Value": "0"},
{"Key": "ag_0_1periods_connect_timeouts", "Value": "0"},
{"Key": "ag_0_1periods_connect_failures", "Value": "0"},
{"Key": "ag_0_1periods_network_errors", "Value": "0"},
{"Key": "ag_0_1periods_wrong_replies", "Value": "0"},
{"Key": "ag_0_1periods_unexpected_closings", "Value": "0"},
{"Key": "ag_0_1periods_warnings", "Value": "0"},
{"Key": "ag_0_1periods_succeeded_queries", "Value": "27"},
{"Key": "ag_0_1periods_msecsperquery", "Value": "232.31"},
{"Key": "ag_0_5periods_query_timeouts", "Value": "0"},
{"Key": "ag_0_5periods_connect_timeouts", "Value": "0"},
{"Key": "ag_0_5periods_connect_failures", "Value": "0"},
{"Key": "ag_0_5periods_network_errors", "Value": "0"},
{"Key": "ag_0_5periods_wrong_replies", "Value": "0"},
{"Key": "ag_0_5periods_unexpected_closings", "Value": "0"},
{"Key": "ag_0_5periods_warnings", "Value": "0"},
{"Key": "ag_0_5periods_succeeded_queries", "Value": "146"},
{"Key": "ag_0_5periods_msecsperquery", "Value": "231.83"},
{"Key": "ag_1_hostname 192.168.0.202:6714"},
{"Key": "ag_1_references", "Value": "2"},
{"Key": "ag_1_lastquery", "Value": "0.41"},
{"Key": "ag_1_lastanswer", "Value": "0.19"},
{"Key": "ag_1_lastperiodmsec", "Value": "220"},
{"Key": "ag_1_errorsarow", "Value": "0"},
{"Key": "ag_1_1periods_query_timeouts", "Value": "0"},
{"Key": "ag_1_1periods_connect_timeouts", "Value": "0"},
{"Key": "ag_1_1periods_connect_failures", "Value": "0"},
{"Key": "ag_1_1periods_network_errors", "Value": "0"},
{"Key": "ag_1_1periods_wrong_replies", "Value": "0"},
{"Key": "ag_1_1periods_unexpected_closings", "Value": "0"},
{"Key": "ag_1_1periods_warnings", "Value": "0"},
{"Key": "ag_1_1periods_succeeded_queries", "Value": "27"},
{"Key": "ag_1_1periods_msecsperquery", "Value": "231.24"},
{"Key": "ag_1_5periods_query_timeouts", "Value": "0"},
{"Key": "ag_1_5periods_connect_timeouts", "Value": "0"},
{"Key": "ag_1_5periods_connect_failures", "Value": "0"},
{"Key": "ag_1_5periods_network_errors", "Value": "0"},
{"Key": "ag_1_5periods_wrong_replies", "Value": "0"},
{"Key": "ag_1_5periods_warnings", "Value": "0"},
{"Key": "ag_1_5periods_succeeded_queries", "Value": "146"},
{"Key": "ag_1_5periods_msecsperquery", "Value": "230.85"}
],
"error": "",
"total": 0,
"warning": ""
}
An optional LIKE
clause is supported, with the syntax being the same as in SHOW STATUS
.
SHOW AGENT STATUS LIKE '%5period%msec%';
+-----------------------------+--------+
| Key | Value |
+-----------------------------+--------+
| ag_0_5periods_msecsperquery | 234.72 |
| ag_1_5periods_msecsperquery | 233.73 |
| ag_2_5periods_msecsperquery | 343.81 |
+-----------------------------+--------+
3 rows in set (0.00 sec)
$client->nodes()->agentstatus(
['body'=>
['pattern'=>'%5period%msec%']
]
);
Array(
[ag_0_5periods_msecsperquery] => 234.72
[ag_1_5periods_msecsperquery] => 233.73
[ag_2_5periods_msecsperquery] => 343.81
)
utilsApi.sql('SHOW AGENT STATUS LIKE \'%5period%msec%\'')
{u'columns': [{u'Key': {u'type': u'string'}},
{u'Value': {u'type': u'string'}}],
u'data': [
{u'Key': u'ag_0_5periods_msecsperquery', u'Value': u'234.72'},
{u'Key': u'ag_1_5periods_msecsperquery', u'Value': u'233.73'},
{u'Key': u'ag_2_5periods_msecsperquery', u'Value': u'343.81'}],
u'error': u'',
u'total': 0,
u'warning': u''}
res = await utilsApi.sql("SHOW AGENT STATUS LIKE \"%5period%msec%\"");
{"columns": [{"Key": {"type": "string"}},
{"Value": {"type": "string"}}],
"data": [
{"Key": "ag_0_5periods_msecsperquery", "Value": "234.72"},
{"Key": "ag_1_5periods_msecsperquery", "Value": "233.73"},
{"Key": "ag_2_5periods_msecsperquery", "Value": "343.81"}],
"error": "",
"total": 0,
"warning": ""}
utilsApi.sql("SHOW AGENT STATUS LIKE \"%5period%msec%\"");
{columns: [{Key={type=string}},
{Value={type=string}}],
data: [
{Key=ag_0_5periods_msecsperquery, Value=234.72},
{Key=ag_1_5periods_msecsperquery, Value=233.73},
{Key=ag_2_5periods_msecsperquery, Value=343.81}],
error: ,
total: 0,
warning: }
utilsApi.Sql("SHOW AGENT STATUS LIKE \"%5period%msec%\"");
{columns: [{Key={type=string}},
{Value={type=string}}],
data: [
{Key=ag_0_5periods_msecsperquery, Value=234.72},
{Key=ag_1_5periods_msecsperquery, Value=233.73},
{Key=ag_2_5periods_msecsperquery, Value=343.81}],
error: "",
total: 0,
warning: ""}
res = await utilsApi.sql("SHOW AGENT STATUS LIKE \"%5period%msec%\"");
{
"columns":
[{
"Key": {"type": "string"}
},
{
"Value": {"type": "string"}
}],
"data":
[
{"Key": "ag_0_5periods_msecsperquery", "Value": "234.72"},
{"Key": "ag_1_5periods_msecsperquery", "Value": "233.73"},
{"Key": "ag_2_5periods_msecsperquery", "Value": "343.81"}
],
"error": "",
"total": 0,
"warning": ""
}
apiClient.UtilsAPI.Sql(context.Background()).Body("SHOW AGENT STATUS LIKE \"%5period%msec%\"").Execute()
{
"columns":
[{
"Key": {"type": "string"}
},
{
"Value": {"type": "string"}
}],
"data":
[
{"Key": "ag_0_5periods_msecsperquery", "Value": "234.72"},
{"Key": "ag_1_5periods_msecsperquery", "Value": "233.73"},
{"Key": "ag_2_5periods_msecsperquery", "Value": "343.81"}
],
"error": "",
"total": 0,
"warning": ""
}
You can specify a particular agent by its address. In this case, only that agent's data will be displayed. Additionally, the agent_
prefix will be used instead of ag_N_
:
SHOW AGENT '192.168.0.202:6714' STATUS LIKE '%15periods%';
+-------------------------------------+--------+
| Variable_name | Value |
+-------------------------------------+--------+
| agent_15periods_query_timeouts | 0 |
| agent_15periods_connect_timeouts | 0 |
| agent_15periods_connect_failures | 0 |
| agent_15periods_network_errors | 0 |
| agent_15periods_wrong_replies | 0 |
| agent_15periods_unexpected_closings | 0 |
| agent_15periods_warnings | 0 |
| agent_15periods_succeeded_queries | 439 |
| agent_15periods_msecsperquery | 231.73 |
+-------------------------------------+--------+
9 rows in set (0.00 sec)
$client->nodes()->agentstatus(
['body'=>
['agent'=>'192.168.0.202:6714'],
['pattern'=>'%5period%msec%']
]
);
Array(
[agent_15periods_query_timeouts] => 0
[agent_15periods_connect_timeouts] => 0
[agent_15periods_connect_failures] => 0
[agent_15periods_network_errors] => 0
[agent_15periods_wrong_replies] => 0
[agent_15periods_unexpected_closings] => 0
[agent_15periods_warnings] => 0
[agent_15periods_succeeded_queries] => 439
[agent_15periods_msecsperquery] => 231.73
)
utilsApi.sql('SHOW AGENT \'192.168.0.202:6714\' STATUS LIKE \'%15periods%\'')
{u'columns': [{u'Key': {u'type': u'string'}},
{u'Value': {u'type': u'string'}}],
u'data': [
{u'Key': u'agent_15periods_query_timeouts', u'Value': u'0'},
{u'Key': u'agent_15periods_connect_timeouts', u'Value': u'0'},
{u'Key': u'agent_15periods_connect_failures', u'Value': u'0'},
{u'Key': u'agent_15periods_network_errors', u'Value': u'0'},
{u'Key': u'agent_15periods_connect_failures', u'Value': u'0'},
{u'Key': u'agent_15periods_wrong_replies', u'Value': u'0'},
{u'Key': u'agent_15periods_unexpected_closings', u'Value': u'0'},
{u'Key': u'agent_15periods_warnings', u'Value': u'0'},
{u'Key': u'agent_15periods_succeeded_queries', u'Value': u'439'},
{u'Key': u'agent_15periods_msecsperquery', u'Value': u'233.73'},
],
u'error': u'',
u'total': 0,
u'warning': u''}
res = await utilsApi.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");
{"columns": [{"Key": {"type": "string"}},
{"Value": {"type": "string"}}],
"data": [
{"Key": "agent_15periods_query_timeouts", "Value": "0"},
{"Key": "agent_15periods_connect_timeouts", "Value": "0"},
{"Key": "agent_15periods_connect_failures", "Value": "0"},
{"Key": "agent_15periods_network_errors", "Value": "0"},
{"Key": "agent_15periods_connect_failures", "Value": "0"},
{"Key": "agent_15periods_wrong_replies", "Value": "0"},
{"Key": "agent_15periods_unexpected_closings", "Value": "0"},
{"Key": "agent_15periods_warnings", "Value": "0"},
{"Key": "agent_15periods_succeeded_queries", "Value": "439"},
{"Key": "agent_15periods_msecsperquery", "Value": "233.73"},
],
"error": "",
"total": 0,
"warning": ""}
utilsApi.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");
{columns=[{Key={type=string}},
{Value={type=string}}],
data=[
{Key=agent_15periods_query_timeouts, Value=0},
{Key=agent_15periods_connect_timeouts, Value=0},
{Key=agent_15periods_connect_failures, Value=0},
{Key=agent_15periods_network_errors, Value=0},
{Key=agent_15periods_connect_failures, Value=0},
{Key=agent_15periods_wrong_replies, Value=0},
{Key=agent_15periods_unexpected_closings, Value=0},
{Key=agent_15periods_warnings, Value=0},
{Key=agent_15periods_succeeded_queries, Value=439},
{Key=agent_15periods_msecsperquery, Value=233.73},
],
error=,
total=0,
warning=}
utilsApi.Sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");
{columns=[{Key={type=string}},
{Value={type=string}}],
data=[
{Key=agent_15periods_query_timeouts, Value=0},
{Key=agent_15periods_connect_timeouts, Value=0},
{Key=agent_15periods_connect_failures, Value=0},
{Key=agent_15periods_network_errors, Value=0},
{Key=agent_15periods_connect_failures, Value=0},
{Key=agent_15periods_wrong_replies, Value=0},
{Key=agent_15periods_unexpected_closings, Value=0},
{Key=agent_15periods_warnings, Value=0},
{Key=agent_15periods_succeeded_queries, Value=439},
{Key=agent_15periods_msecsperquery, Value=233.73},
],
error="",
total=0,
warning=""}
res = await utilsApi.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");
{
"columns":
[{
{"Key": {"type": "string"}
},
{"Value": {"type": "string"}
}],
"data":
[
{"Key": "agent_15periods_query_timeouts", "Value": "0"},
{"Key": "agent_15periods_connect_timeouts", "Value": "0"},
{"Key": "agent_15periods_connect_failures", "Value": "0"},
{"Key": "agent_15periods_network_errors", "Value": "0"},
{"Key": "agent_15periods_connect_failures", "Value": "0"},
{"Key": "agent_15periods_wrong_replies", "Value": "0"},
{"Key": "agent_15periods_unexpected_closings", "Value": "0"},
{"Key": "agent_15periods_warnings", "Value": "0"},
{"Key": "agent_15periods_succeeded_queries", "Value": "439"},
{"Key": "agent_15periods_msecsperquery", "Value": "233.73"},
],
"error": "",
"total": 0,
"warning": ""
}
apiClient.UtilsAPI.Sql(context.Background()).Body("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\").Execute()
{
"columns":
[{
{"Key": {"type": "string"}
},
{"Value": {"type": "string"}
}],
"data":
[
{"Key": "agent_15periods_query_timeouts", "Value": "0"},
{"Key": "agent_15periods_connect_timeouts", "Value": "0"},
{"Key": "agent_15periods_connect_failures", "Value": "0"},
{"Key": "agent_15periods_network_errors", "Value": "0"},
{"Key": "agent_15periods_connect_failures", "Value": "0"},
{"Key": "agent_15periods_wrong_replies", "Value": "0"},
{"Key": "agent_15periods_unexpected_closings", "Value": "0"},
{"Key": "agent_15periods_warnings", "Value": "0"},
{"Key": "agent_15periods_succeeded_queries", "Value": "439"},
{"Key": "agent_15periods_msecsperquery", "Value": "233.73"},
],
"error": "",
"total": 0,
"warning": ""
}
Finally, you can check the status of the agents in a specific distributed table using the SHOW AGENT index_name STATUS
statement. This statement displays the table's HA status (i.e., whether or not it uses agent mirrors at all) and provides information on the mirrors, including: address, blackhole and persistent flags, and the mirror selection probability used when one of the weighted probability strategies is in effect.
SHOW AGENT dist_index STATUS;
+--------------------------------------+--------------------------------+
| Variable_name | Value |
+--------------------------------------+--------------------------------+
| dstindex_1_is_ha | 1 |
| dstindex_1mirror1_id | 192.168.0.202:6713:loc |
| dstindex_1mirror1_probability_weight | 0.372864 |
| dstindex_1mirror1_is_blackhole | 0 |
| dstindex_1mirror1_is_persistent | 0 |
| dstindex_1mirror2_id | 192.168.0.202:6714:loc |
| dstindex_1mirror2_probability_weight | 0.374635 |
| dstindex_1mirror2_is_blackhole | 0 |
| dstindex_1mirror2_is_persistent | 0 |
| dstindex_1mirror3_id | dev1.manticoresearch.com:6714:loc |
| dstindex_1mirror3_probability_weight | 0.252501 |
| dstindex_1mirror3_is_blackhole | 0 |
| dstindex_1mirror3_is_persistent | 0 |
+--------------------------------------+--------------------------------+
13 rows in set (0.00 sec)
$client->nodes()->agentstatus(
['body'=>
['agent'=>'dist_index']
]
);
Array(
[dstindex_1_is_ha] => 1
[dstindex_1mirror1_id] => 192.168.0.202:6713:loc
[dstindex_1mirror1_probability_weight] => 0.372864
[dstindex_1mirror1_is_blackhole] => 0
[dstindex_1mirror1_is_persistent] => 0
[dstindex_1mirror2_id] => 192.168.0.202:6714:loc
[dstindex_1mirror2_probability_weight] => 0.374635
[dstindex_1mirror2_is_blackhole] => 0
[dstindex_1mirror2_is_persistent] => 0
[dstindex_1mirror3_id] => dev1.manticoresearch.com:6714:loc
[dstindex_1mirror3_probability_weight] => 0.252501
[dstindex_1mirror3_is_blackhole] => 0
[dstindex_1mirror3_is_persistent] => 0
)
utilsApi.sql('SHOW AGENT \'192.168.0.202:6714\' STATUS LIKE \'%15periods%\'')
{u'columns': [{u'Key': {u'type': u'string'}},
{u'Value': {u'type': u'string'}}],
u'data': [
{u'Key': u'dstindex_1_is_ha', u'Value': u'1'},
{u'Key': u'dstindex_1mirror1_id', u'Value': u'192.168.0.202:6713:loc'},
{u'Key': u'dstindex_1mirror1_probability_weight', u'Value': u'0.372864'},
{u'Key': u'dstindex_1mirror1_is_blackhole', u'Value': u'0'},
{u'Key': u'dstindex_1mirror1_is_persistent', u'Value': u'0'},
{u'Key': u'dstindex_1mirror2_id', u'Value': u'192.168.0.202:6714:loc'},
{u'Key': u'dstindex_1mirror2_probability_weight', u'Value': u'0.374635'},
{u'Key': u'dstindex_1mirror2_is_blackhole', u'Value': u'0'},
{u'Key': u'dstindex_1mirror2_is_persistent', u'Value': u'439'},
{u'Key': u'dstindex_1mirror3_id', u'Value': u'dev1.manticoresearch.com:6714:loc'},
{u'Key': u'dstindex_1mirror3_probability_weight', u'Value': u' 0.252501'},
{u'Key': u'dstindex_1mirror3_is_blackhole', u'Value': u'0'},
{u'Key': u'dstindex_1mirror3_is_persistent', u'Value': u'439'}
],
u'error': u'',
u'total': 0,
u'warning': u''}
res = await utilsApi.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");
{"columns": [{"Key": {"type": "string"}},
{"Value": {"type": "string"}}],
"data": [
{"Key": "dstindex_1_is_ha", "Value": "1"},
{"Key": "dstindex_1mirror1_id", "Value": "192.168.0.202:6713:loc"},
{"Key": "dstindex_1mirror1_probability_weight", "Value": "0.372864"},
{"Key": "dstindex_1mirror1_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror1_is_persistent", "Value": "0"},
{"Key": "dstindex_1mirror2_id", "Value": "192.168.0.202:6714:loc"},
{"Key": "dstindex_1mirror2_probability_weight", "Value": "0.374635"},
{"Key": "dstindex_1mirror2_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror2_is_persistent", "Value": "439"},
{"Key": "dstindex_1mirror3_id", "Value": "dev1.manticoresearch.com:6714:loc"},
{"Key": "dstindex_1mirror3_probability_weight", "Value": " 0.252501"},
{"Key": "dstindex_1mirror3_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror3_is_persistent", "Value": "439"}
],
"error": "",
"total": 0,
"warning": ""}
utilsApi.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");
{columns=[{Key={type=string}},
{Value={type=string}}],
data=[
{Key=dstindex_1_is_ha, Value=1},
{Key=dstindex_1mirror1_id, Value=192.168.0.202:6713:loc},
{Key=dstindex_1mirror1_probability_weight, Value=0.372864},
{Key=dstindex_1mirror1_is_blackhole, Value=0},
{Key=dstindex_1mirror1_is_persistent, Value=0},
{Key=dstindex_1mirror2_id, Value=192.168.0.202:6714:loc},
{Key=dstindex_1mirror2_probability_weight, Value=0.374635},
{Key=dstindex_1mirror2_is_blackhole, Value=0},
{Key=dstindex_1mirror2_is_persistent, Value=439},
{Key=dstindex_1mirror3_id, Value=dev1.manticoresearch.com:6714:loc},
{Key=dstindex_1mirror3_probability_weight, Value= 0.252501},
{Key=dstindex_1mirror3_is_blackhole, Value=0},
{Key=dstindex_1mirror3_is_persistent, Value=439}
],
error=,
total=0,
warning=}
utilsApi.Sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");
{columns=[{Key={type=string}},
{Value={type=string}}],
data=[
{Key=dstindex_1_is_ha, Value=1},
{Key=dstindex_1mirror1_id, Value=192.168.0.202:6713:loc},
{Key=dstindex_1mirror1_probability_weight, Value=0.372864},
{Key=dstindex_1mirror1_is_blackhole, Value=0},
{Key=dstindex_1mirror1_is_persistent, Value=0},
{Key=dstindex_1mirror2_id, Value=192.168.0.202:6714:loc},
{Key=dstindex_1mirror2_probability_weight, Value=0.374635},
{Key=dstindex_1mirror2_is_blackhole, Value=0},
{Key=dstindex_1mirror2_is_persistent, Value=439},
{Key=dstindex_1mirror3_id, Value=dev1.manticoresearch.com:6714:loc},
{Key=dstindex_1mirror3_probability_weight, Value= 0.252501},
{Key=dstindex_1mirror3_is_blackhole, Value=0},
{Key=dstindex_1mirror3_is_persistent, Value=439}
],
error="",
total=0,
warning=""}
res = await utilsApi.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");
{
"columns":
[{
"Key": {"type": "string"}},
{"Value": {"type": "string"}
}],
"data":
[
{"Key": "dstindex_1_is_ha", "Value": "1"},
{"Key": "dstindex_1mirror1_id", "Value": "192.168.0.202:6713:loc"},
{"Key": "dstindex_1mirror1_probability_weight", "Value": "0.372864"},
{"Key": "dstindex_1mirror1_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror1_is_persistent", "Value": "0"},
{"Key": "dstindex_1mirror2_id", "Value": "192.168.0.202:6714:loc"},
{"Key": "dstindex_1mirror2_probability_weight", "Value": "0.374635"},
{"Key": "dstindex_1mirror2_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror2_is_persistent", "Value": "439"},
{"Key": "dstindex_1mirror3_id", "Value": "dev1.manticoresearch.com:6714:loc"},
{"Key": "dstindex_1mirror3_probability_weight", "Value": " 0.252501"},
{"Key": "dstindex_1mirror3_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror3_is_persistent", "Value": "439"}
],
"error": "",
"total": 0,
"warning": ""
}
apiClient.UtilsAPI.Sql(context.Background()).Body("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"").Execute()
{
"columns":
[{
"Key": {"type": "string"}},
{"Value": {"type": "string"}
}],
"data":
[
{"Key": "dstindex_1_is_ha", "Value": "1"},
{"Key": "dstindex_1mirror1_id", "Value": "192.168.0.202:6713:loc"},
{"Key": "dstindex_1mirror1_probability_weight", "Value": "0.372864"},
{"Key": "dstindex_1mirror1_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror1_is_persistent", "Value": "0"},
{"Key": "dstindex_1mirror2_id", "Value": "192.168.0.202:6714:loc"},
{"Key": "dstindex_1mirror2_probability_weight", "Value": "0.374635"},
{"Key": "dstindex_1mirror2_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror2_is_persistent", "Value": "439"},
{"Key": "dstindex_1mirror3_id", "Value": "dev1.manticoresearch.com:6714:loc"},
{"Key": "dstindex_1mirror3_probability_weight", "Value": " 0.252501"},
{"Key": "dstindex_1mirror3_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror3_is_persistent", "Value": "439"}
],
"error": "",
"total": 0,
"warning": ""
}
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 actually retrieved and sent to the client.total_found
: The estimated total number of matches for the query in the index.total_relation
: If Manticore cannot calculate the exact total
value, this field will display total_relation: gte
, indicating that the actual count is Greater Than or Equal to total_found
. If the total
value is precise, total_relation: eq
will be shown.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).SELECT id, story_author FROM hn_small WHERE MATCH('one|two|three') and comment_ranking > 2 limit 5;
show meta;
+---------+--------------+
| 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)
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.
SELECT id,channel_id FROM records 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)
+-----------------------+--------+
| 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)
Additional values, such as predicted_time
, dist_predicted_time
, local_fetched_docs
, local_fetched_hits
, local_fetched_skips
, and their respective dist_fetched_*
counterparts, will only be available if searchd
was configured with predicted time costs and the query included predicted_time
in the OPTION
clause.
SELECT id,story_author FROM hn_small WHERE MATCH('one|two|three') limit 5 option max_predicted_time=100;
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 |
| local_fetched_docs | 307212 |
| local_fetched_hits | 407390 |
| local_fetched_skips | 24 |
| predicted_time | 56 |
| 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)
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.
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)
+----------------+--------+
| 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)
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.
SHOW META LIKE 'total%';
+----------------+--------+
| Variable_name | Value |
+----------------+--------+
| total | 5 |
| total_found | 266385 |
| total_relation | eq |
+----------------+--------+
3 rows in set (0.00 sec)
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.
SELECT * FROM facetdemo FACET brand_id FACET price FACET categories;
SHOW META LIKE 'multiplier';
+------+-------+----------+---------------------+-------------+-------------+---------------------------------------+------------+
| 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)
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.
SELECT count(*) FROM taxi1 WHERE tip_amount = 5;
SHOW META;
+----------------+----------------------------------+
| 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)
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 tableTotal queries stored
- Total number of queries stored in the tableTerm only queries
- Number of queries in the table that have terms; the remaining queries use extended query syntax.CALL PQ ('pq', ('{"title":"angry", "gid":3 }')); SHOW META;
+------+
| id |
+------+
| 2 |
+------+
1 row in set (0.00 sec)
+-----------------------+-----------+
| 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 optionsQueries failed
- Number of queries that failedFast rejected queries
- Number of queries that were not fully evaluated but quickly matched and rejected using filters or other conditionsTime per query
- Detailed time for each queryTime of matched queries
- Total time spent on queries that matched any documentsCALL PQ ('pq', ('{"title":"angry", "gid":3 }'), 1 as verbose); SHOW META;
+------+
| id |
+------+
| 2 |
+------+
1 row in set (0.00 sec)
+-------------------------+-----------+
| 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)
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 kernelName
: Thread name, also visible in top
, htop
, ps
, and other process-viewing toolsProto
: 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 threadThread 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 tableSHOW THREADS;
*************************** 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.15%
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.23%
Jobs done: 1830
Thread status: working
Info: show threads
POST /cli -d "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 |
+--------+---------+-------+-------+-----------------+--------+-----------------------+-----------+---------------+--------------+
require_once __DIR__ . '/vendor/autoload.php';
$config = ['host'=>'127.0.0.1','port'=>9308];
$client = new \Manticoresearch\Client($config);
print_r($client->nodes()->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] => 93.54%
[Jobs done] => 8
[Thread status] => working
[Info] => show_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'))
[{'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': 'float'}}, {'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': '91.85%', 'Jobs done': 943, 'Thread status': 'working', 'Info': 'show_threads'}], 'total': 1, 'error': '', 'warning': ''}]
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();
[
{
"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": "float"
}
},
{
"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": "91.73%",
"Jobs done": 3328,
"Thread status": "working",
"Info": "show_threads"
}
],
"total": 1,
"error": "",
"warning": ""
}
]
utilsApi.sql("SHOW THREADS");
{
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=44.68%,
Jobs done=849,
Thread status=working,
Info=show_threads
}
],
total=0,
error=,
warning=
}
utilsApi.Sql("SHOW THREADS");
{
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=""
}
res = await utilsApi.sql('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": "float"
}
},
{
"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": "91.73%",
"Jobs done": 3328,
"Thread status": "working",
"Info": "show_threads"
}
],
"total": 1,
"error": "",
"warning": ""
}
]
apiClient.UtilsAPI.Sql(context.Background()).Body("SHOW THREADS").Execute()
[
{
"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": "float"
}
},
{
"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": "91.73%",
"Jobs done": 3328,
"Thread status": "working",
"Info": "show_threads"
}
],
"total": 1,
"error": "",
"warning": ""
}
]
The Info
column displays:
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).
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')
res = await utilsApi.sql('SHOW THREADS OPTION columns=30');
utilsApi.sql("SHOW THREADS OPTION columns=30");
utilsApi.Sql("SHOW THREADS OPTION columns=30");
res = await utilsApi.sql('SHOW THREADS OPTION columns=30');
apiClient.UtilsAPI.Sql(context.Background()).Body("SHOW THREADS OPTION columns=30").Execute()
SHOW QUERIES
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 queryquery
: Query statement or a portion of ittime
: Time taken on command execution or how long ago the query was performedprotocol
: 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
mysql> SHOW QUERIES;
+------+--------------+---------+----------+-----------------+
| 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)
Refer to SHOW THREADS if you'd like to gain insight from the perspective of the threads themselves.
SHOW VERSION
SHOW VERSION
provides detailed version information of various components of the Manticore Search instance. This command is particularly useful for administrators and developers who need to verify the version of Manticore Search they are running, along with the versions of its associated components.
The output table includes two columns:
- Component
: This column names the specific component of Manticore Search.
- Version
: This column displays the version information for the respective component.
mysql> SHOW VERSION;
+-----------+--------------------------------+
| Component | Version |
+-----------+--------------------------------+
| Daemon | 6.2.13 61cfe38d2@24011520 dev |
| Columnar | columnar 2.2.5 214ce90@240115 |
| Secondary | secondary 2.2.5 214ce90@240115 |
| KNN | knn 2.2.5 214ce90@240115 |
| Buddy | buddy v2.0.11 |
+-----------+--------------------------------+
KILL <query id>
KILL
terminates the execution of a query by its ID, which you can find in SHOW QUERIES.
mysql> KILL 4;
Query OK, 1 row affected (0.00 sec)
SHOW WARNINGS
statement can be used to retrieve the warning produced by the latest query. The error message will be returned along with the query itself:
mysql> SELECT * FROM test1 WHERE MATCH('@@title hello') \G
ERROR 1064 (42000): index test1: syntax error, unexpected TOK_FIELDLIMIT
near '@title hello'
mysql> SELECT * FROM test1 WHERE MATCH('@title -hello') \G
ERROR 1064 (42000): index test1: query is non-computable (single NOT operator)
mysql> SELECT * FROM test1 WHERE MATCH('"test doc"/3') \G
*************************** 1\. row ***************************
id: 4
weight: 2500
group_id: 2
date_added: 1231721236
1 row in set, 1 warning (0.00 sec)
mysql> SHOW WARNINGS \G
*************************** 1\. row ***************************
Level: warning
Code: 1000
Message: quorum threshold too high (words=2, thresh=3); replacing quorum operator
with AND operator
1 row in set (0.00 sec)
SHOW [{GLOBAL | SESSION}] VARIABLES LIKE 'pattern'
It returns the current values of a few server-wide variables. Also, support for GLOBAL
and SESSION
clauses was added.
mysql> SHOW GLOBAL VARIABLES;
+--------------------------+-----------+
| Variable_name | Value |
+--------------------------+-----------+
| autocommit | 1 |
| collation_connection | libc_ci |
| query_log_format | sphinxql |
| log_level | info |
| max_allowed_packet | 134217728 |
| character_set_client | utf8 |
| character_set_connection | utf8 |
| grouping_in_utc | 0 |
| last_insert_id | 123, 200 |
+--------------------------+-----------+
9 rows in set (0.00 sec)
mysql> show variables like '%log%';
+------------------+----------+
| Variable_name | Value |
+------------------+----------+
| query_log_format | sphinxql |
| log_level | info |
+------------------+----------+
2 rows in set (0.00 sec)
mysql> show session variables like 'autocommit';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| autocommit | 0 |
+---------------+-------+
1 row in set (0.00 sec)
The SQL SHOW PROFILE
statement and the "profile": true
JSON interface option both provide a detailed execution profile of the executed query. In the case of SQL, profiling must be enabled in the current session before running the statement to be instrumented. This can be accomplished with the SET profiling=1
statement. By default, profiling is disabled to prevent potential performance implications, resulting in an empty profile if not enabled.
Each profiling result includes the following fields:
Status
column briefly describes the specific state where the time was spent. See below.Duration
column shows the wall clock time, in seconds.Switches
column displays the number of times the query engine changed to the given state. These are merely logical engine state switches and not any OS level context switches or function calls (although some sections might actually map to function calls), and they do not have any direct effect on performance. In a sense, the number of switches is just the number of times the respective instrumentation point was hit.Percent
column shows the percentage of time spent in this state.States in the profile are returned in a prerecorded order that roughly maps (but is not identical) to the actual query order.
The list of states may (and will) change over time as we refine the states. Here's a brief description of the currently profiled states.
unknown
: generic catch-all state. Accounts for not-yet-instrumented code or small miscellaneous tasks that don't really belong in any other state but are too small to warrant their own state.net_read
: reading the query from the network (i.e., the application).io
: generic file IO time.dist_connect
: connecting to remote agents in the distributed table case.sql_parse
: parsing the SQL syntax.dict_setup
: dictionary and tokenizer setup.parse
: parsing the full-text query syntax.transforms
: full-text query transformations (wildcard and other expansions, simplification, etc.).init
: initializing the query evaluation.open
: opening the table files.read_docs
: IO time spent reading document lists.read_hits
: IO time spent reading keyword positions.get_docs
: computing the matching documents.get_hits
: computing the matching positions.filter
: filtering the full-text matches.rank
: computing the relevance rank.sort
: sorting the matches.finalize
: finalizing the per-table search result set (last stage expressions, etc.).dist_wait
: waiting for remote results from agents in the distributed table case.aggregate
: aggregating multiple result sets.net_write
: writing the result set to the network.SET profiling=1;
SELECT id FROM forum WHERE MATCH('the best') LIMIT 1;
SHOW PROFILE;
Query OK, 0 rows affected (0.00 sec)
+--------+
| id |
+--------+
| 241629 |
+--------+
1 row in set (0.35 sec)
+--------------+----------+----------+---------+
| Status | Duration | Switches | Percent |
+--------------+----------+----------+---------+
| unknown | 0.000557 | 5 | 0.16 |
| net_read | 0.000016 | 1 | 0.00 |
| local_search | 0.000076 | 1 | 0.02 |
| sql_parse | 0.000121 | 1 | 0.03 |
| dict_setup | 0.000003 | 1 | 0.00 |
| parse | 0.000072 | 1 | 0.02 |
| transforms | 0.000331 | 2 | 0.10 |
| init | 0.001945 | 3 | 0.56 |
| read_docs | 0.001257 | 76 | 0.36 |
| read_hits | 0.002598 | 186 | 0.75 |
| get_docs | 0.089328 | 2691 | 25.80 |
| get_hits | 0.189626 | 2799 | 54.78 |
| filter | 0.009369 | 2613 | 2.71 |
| rank | 0.029669 | 7760 | 8.57 |
| sort | 0.019070 | 2531 | 5.51 |
| finalize | 0.000001 | 1 | 0.00 |
| clone_attrs | 0.002009 | 1 | 0.58 |
| aggregate | 0.000054 | 2 | 0.02 |
| net_write | 0.000076 | 2 | 0.02 |
| eval_post | 0.000001 | 1 | 0.00 |
| total | 0.346179 | 18678 | 0 |
+--------------+----------+----------+---------+
21 rows in set (0.00 sec)
POST /search
{
"index": "test",
"profile": true,
"query":
{
"match_phrase": { "_all" : "had grown quite" }
}
}
"profile": {
"query": [
{
"status": "unknown",
"duration": 0.000141,
"switches": 8,
"percent": 2.17
},
{
"status": "local_df",
"duration": 0.000870,
"switches": 1,
"percent": 13.40
},
{
"status": "local_search",
"duration": 0.001038,
"switches": 2,
"percent": 15.99
},
{
"status": "setup_iter",
"duration": 0.000154,
"switches": 14,
"percent": 2.37
},
{
"status": "dict_setup",
"duration": 0.000026,
"switches": 3,
"percent": 0.40
},
{
"status": "parse",
"duration": 0.000205,
"switches": 3,
"percent": 3.15
},
{
"status": "transforms",
"duration": 0.000974,
"switches": 4,
"percent": 15.01
},
{
"status": "init",
"duration": 0.002931,
"switches": 20,
"percent": 45.16
},
{
"status": "get_docs",
"duration": 0.000007,
"switches": 7,
"percent": 0.10
},
{
"status": "rank",
"duration": 0.000002,
"switches": 14,
"percent": 0.03
},
{
"status": "finalize",
"duration": 0.000013,
"switches": 7,
"percent": 0.20
},
{
"status": "aggregate",
"duration": 0.000128,
"switches": 1,
"percent": 1.97
},
{
"status": "total",
"duration": 0.006489,
"switches": 84,
"percent": 100.00
}
]
}
The SHOW PLAN
SQL statement and the "plan": N
JSON interface option display the query execution plan. The plan is generated and stored during the actual execution, so in the case of SQL, profiling must be enabled in the current session before running that statement. This can be done with a SET profiling=1
statement.
Two items are returned in SQL mode:
transformed_tree
, which displays the full-text query decomposition.enabled_indexes
, which provides information about effective secondary indexes.To view the query execution plan in a JSON query, add "plan": N
to the query. The result will appear as a plan
property in the result set. N
can be one of the following:
SHOW PLAN
SQL query. This is the most compact form.set profiling=1;
select * from hn_small where match('dog|cat') limit 0;
show plan;
*************************** 1. row ***************************
Variable: transformed_tree
Value: OR(
AND(KEYWORD(dog, querypos=1)),
AND(KEYWORD(cat, querypos=2)))
*************************** 2. row ***************************
Variable: enabled_indexes
Value:
2 rows in set (0.00 sec)
POST /search
{
"index": "hn_small",
"query": {"query_string": "dog|cat"},
"_source": { "excludes":["*"] },
"limit": 0,
"plan": 3
}
{
"took": 0,
"timed_out": false,
"hits": {
"total": 4453,
"total_relation": "eq",
"hits": []
},
"plan": {
"query": {
"type": "OR",
"description": "OR( AND(KEYWORD(dog, querypos=1)), AND(KEYWORD(cat, querypos=2)))",
"children": [
{
"type": "AND",
"description": "AND(KEYWORD(dog, querypos=1))",
"children": [
{
"type": "KEYWORD",
"word": "dog",
"querypos": 1
}
]
},
{
"type": "AND",
"description": "AND(KEYWORD(cat, querypos=2))",
"children": [
{
"type": "KEYWORD",
"word": "cat",
"querypos": 2
}
]
}
]
}
}
}
In some cases, the evaluated query tree can be quite different from the original one due to expansions and other transformations.
SET profiling=1;
SELECT id FROM forum WHERE MATCH('@title way* @content hey') LIMIT 1;
SHOW PLAN;
Query OK, 0 rows affected (0.00 sec)
+--------+
| id |
+--------+
| 711651 |
+--------+
1 row in set (0.04 sec)
+------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Variable | Value |
+------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| transformed_tree | AND(
OR(
OR(
AND(fields=(title), KEYWORD(wayne, querypos=1, expanded)),
OR(
AND(fields=(title), KEYWORD(ways, querypos=1, expanded)),
AND(fields=(title), KEYWORD(wayyy, querypos=1, expanded)))),
AND(fields=(title), KEYWORD(way, querypos=1, expanded)),
OR(fields=(title), KEYWORD(way*, querypos=1, expanded))),
AND(fields=(content), KEYWORD(hey, querypos=2))) |
+------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
POST /search
{
"index": "forum",
"query": {"query_string": "@title way* @content hey"},
"_source": { "excludes":["*"] },
"limit": 1,
"plan": 3
}
{
"took":33,
"timed_out":false,
"hits":
{
"total":105,
"hits":
[
{
"_id":"711651",
"_score":2539,
"_source":{}
}
]
},
"plan":
{
"query":
{
"type":"AND",
"description":"AND( OR( OR( AND(fields=(title), KEYWORD(wayne, querypos=1, expanded)), OR( AND(fields=(title), KEYWORD(ways, querypos=1, expanded)), AND(fields=(title), KEYWORD(wayyy, querypos=1, expanded)))), AND(fields=(title), KEYWORD(way, querypos=1, expanded)), OR(fields=(title), KEYWORD(way*, querypos=1, expanded))), AND(fields=(content), KEYWORD(hey, querypos=2)))",
"children":
[
{
"type":"OR",
"description":"OR( OR( AND(fields=(title), KEYWORD(wayne, querypos=1, expanded)), OR( AND(fields=(title), KEYWORD(ways, querypos=1, expanded)), AND(fields=(title), KEYWORD(wayyy, querypos=1, expanded)))), AND(fields=(title), KEYWORD(way, querypos=1, expanded)), OR(fields=(title), KEYWORD(way*, querypos=1, expanded)))",
"children":
[
{
"type":"OR",
"description":"OR( AND(fields=(title), KEYWORD(wayne, querypos=1, expanded)), OR( AND(fields=(title), KEYWORD(ways, querypos=1, expanded)), AND(fields=(title), KEYWORD(wayyy, querypos=1, expanded))))",
"children":
[
{
"type":"AND",
"description":"AND(fields=(title), KEYWORD(wayne, querypos=1, expanded))",
"fields":["title"],
"max_field_pos":0,
"children":
[
{
"type":"KEYWORD",
"word":"wayne",
"querypos":1,
"expanded":true
}
]
},
{
"type":"OR",
"description":"OR( AND(fields=(title), KEYWORD(ways, querypos=1, expanded)), AND(fields=(title), KEYWORD(wayyy, querypos=1, expanded)))",
"children":
[
{
"type":"AND",
"description":"AND(fields=(title), KEYWORD(ways, querypos=1, expanded))",
"fields":["title"],
"max_field_pos":0,
"children":
[
{
"type":"KEYWORD",
"word":"ways",
"querypos":1,
"expanded":true
}
]
},
{
"type":"AND",
"description":"AND(fields=(title), KEYWORD(wayyy, querypos=1, expanded))",
"fields":["title"],
"max_field_pos":0,
"children":
[
{
"type":"KEYWORD",
"word":"wayyy",
"querypos":1,
"expanded":true
}
]
}
]
}
]
},
{
"type":"AND",
"description":"AND(fields=(title), KEYWORD(way, querypos=1, expanded))",
"fields":["title"],
"max_field_pos":0,
"children":
[
{
"type":"KEYWORD",
"word":"way",
"querypos":1,
"expanded":true
}
]
},
{
"type":"OR",
"description":"OR(fields=(title), KEYWORD(way*, querypos=1, expanded))",
"fields":["title"],
"max_field_pos":0,
"children":
[
{
"type":"KEYWORD",
"word":"way*",
"querypos":1,
"expanded":true
}
]
}
]
},
{
"type":"AND",
"description":"AND(fields=(content), KEYWORD(hey, querypos=2))",
"fields":["content"],
"max_field_pos":0,
"children":
[
{
"type":"KEYWORD",
"word":"hey",
"querypos":2
}
]
}
]
}
}
}
POST /search
{
"index": "forum",
"query": {"query_string": "@title way* @content hey"},
"_source": { "excludes":["*"] },
"limit": 1,
"plan": 2
}
{
"took": 33,
"timed_out": false,
"hits": {
"total": 105,
"hits": [
{
"_id": "711651",
"_score": 2539,
"_source": {}
}
]
},
"plan": {
"query": {
"type": "AND",
"children": [
{
"type": "OR",
"children": [
{
"type": "OR",
"children": [
{
"type": "AND",
"fields": [
"title"
],
"max_field_pos": 0,
"children": [
{
"type": "KEYWORD",
"word": "wayne",
"querypos": 1,
"expanded": true
}
]
},
{
"type": "OR",
"children": [
{
"type": "AND",
"fields": [
"title"
],
"max_field_pos": 0,
"children": [
{
"type": "KEYWORD",
"word": "ways",
"querypos": 1,
"expanded": true
}
]
},
{
"type": "AND",
"fields": [
"title"
],
"max_field_pos": 0,
"children": [
{
"type": "KEYWORD",
"word": "wayyy",
"querypos": 1,
"expanded": true
}
]
}
]
}
]
},
{
"type": "AND",
"fields": [
"title"
],
"max_field_pos": 0,
"children": [
{
"type": "KEYWORD",
"word": "way",
"querypos": 1,
"expanded": true
}
]
},
{
"type": "OR",
"fields": [
"title"
],
"max_field_pos": 0,
"children": [
{
"type": "KEYWORD",
"word": "way*",
"querypos": 1,
"expanded": true
}
]
}
]
},
{
"type": "AND",
"fields": [
"content"
],
"max_field_pos": 0,
"children": [
{
"type": "KEYWORD",
"word": "hey",
"querypos": 2
}
]
}
]
}
}
}
POST /search
{
"index": "forum",
"query": {"query_string": "@title way* @content hey"},
"_source": { "excludes":["*"] },
"limit": 1,
"plan": 1
}
{
"took":33,
"timed_out":false,
"hits":
{
"total":105,
"hits":
[
{
"_id":"711651",
"_score":2539,
"_source":{}
}
]
},
"plan":
{
"query":
{
"description":"AND( OR( OR( AND(fields=(title), KEYWORD(wayne, querypos=1, expanded)), OR( AND(fields=(title), KEYWORD(ways, querypos=1, expanded)), AND(fields=(title), KEYWORD(wayyy, querypos=1, expanded)))), AND(fields=(title), KEYWORD(way, querypos=1, expanded)), OR(fields=(title), KEYWORD(way*, querypos=1, expanded))), AND(fields=(content), KEYWORD(hey, querypos=2)))"
}
}
}
See also EXPLAIN QUERY. It displays the execution tree of a full-text query without actually executing the query. Note that when using SHOW PLAN
after a query to a real-time table, the result will be based on a random disk/RAM chunk. Therefore, if you have recently modified the table's tokenization settings, or if the chunks vary significantly in terms of dictionaries, etc., you might not get the result you are expecting. Take this into account and consider using EXPLAIN QUERY
as well.
query
property contains the transformed full-text query tree. Each node contains:
type
: node type. Can be AND
, OR
, PHRASE
, KEYWORD
, etc.description
: query subtree for this node shown as a string (in SHOW PLAN
format).children
: child nodes, if any.max_field_pos
: maximum position within a field.word
: transformed keyword. Keyword nodes only.querypos
: position of this keyword in a query. Keyword nodes only.excluded
: keyword excluded from query. Keyword nodes only.expanded
: keyword added by prefix expansion. Keyword nodes only.field_start
: keyword must occur at the very start of the field. Keyword nodes only.field_end
: keyword must occur at the very end of the field. Keyword nodes only.boost
: keyword IDF will be multiplied by this. Keyword nodes only.SHOW PLAN format=dot
allows returning the full-text query execution tree in a hierarchical format suitable for visualization by existing tools, such as https://dreampuf.github.io/GraphvizOnline:
MySQL [(none)]> show plan option format=dot\G
*************************** 1. row ***************************
Variable: transformed_tree
Value: digraph "transformed_tree"
{
0 [shape=record,style=filled,bgcolor="lightgrey" label="AND"]
0 -> 1
1 [shape=record,style=filled,bgcolor="lightgrey" label="AND"]
1 -> 2
2 [shape=record label="i | { querypos=1 }"]
0 -> 3
3 [shape=record,style=filled,bgcolor="lightgrey" label="AND"]
3 -> 4
4 [shape=record label="me | { querypos=2 }"]
}
SHOW TABLE STATUS
is an SQL statement that displays various per-table statistics.
The syntax is:
SHOW TABLE index_name STATUS
Depending on index type, displayed statistic includes different set of rows:
index_type
.index_type
, query_time_1min
, query_time_5min
,query_time_15min
,query_time_total
, exact_query_time_1min
, exact_query_time_5min
, exact_query_time_15min
, exact_query_time_total
, found_rows_1min
, found_rows_5min
, found_rows_15min
, found_rows_total
.percolate: index_type
, stored_queries
, ram_bytes
, disk_bytes
, max_stack_need
, average_stack_base
, desired_thread_stack
, tid
, tid_saved
, query_time_1min
, query_time_5min
,query_time_15min
,query_time_total
, exact_query_time_1min
, exact_query_time_5min
, exact_query_time_15min
, exact_query_time_total
, found_rows_1min
, found_rows_5min
, found_rows_15min
, found_rows_total
.
plain: index_type
, indexed_documents
, indexed_bytes
, may be set of field_tokens_*
and total_tokens
, ram_bytes
, disk_bytes
, disk_mapped
, disk_mapped_cached
, disk_mapped_doclists
, disk_mapped_cached_doclists
, disk_mapped_hitlists
, disk_mapped_cached_hitlists
, killed_documents
, killed_rate
, query_time_1min
, query_time_5min
,query_time_15min
,query_time_total
, exact_query_time_1min
, exact_query_time_5min
, exact_query_time_15min
, exact_query_time_total
, found_rows_1min
, found_rows_5min
, found_rows_15min
, found_rows_total
.
index_type
, indexed_documents
, indexed_bytes
, may be set of field_tokens_*
and total_tokens
, ram_bytes
, disk_bytes
, disk_mapped
, disk_mapped_cached
, disk_mapped_doclists
, disk_mapped_cached_doclists
, disk_mapped_hitlists
, disk_mapped_cached_hitlists
, killed_documents
, killed_rate
, ram_chunk
, ram_chunk_segments_count
, disk_chunks
, mem_limit
, mem_limit_rate
, ram_bytes_retired
, locked
, tid
, tid_saved
, query_time_1min
, query_time_5min
,query_time_15min
,query_time_total
, exact_query_time_1min
, exact_query_time_5min
, exact_query_time_15min
, exact_query_time_total
, found_rows_1min
, found_rows_5min
, found_rows_15min
, found_rows_total
.Here is the meaning of these values:
index_type
: currently one of disk
, rt
, percolate
, template
, and distributed
.indexed_documents
: number of indexed documents.indexed_bytes
: overall size of indexed text. Notice, this value is not strict, since in full-text index that is impossible to strictly recover back stored text to measure it.stored_queries
: number of percolate queries, stored in the table.field_tokens_XXX
: optional, total per-field lengths (in tokens) across the entire table (used internally for BM25A
and BM25F
ranking functions). Only available for tables built with index_field_lengths=1
.total_tokens
: optional, overall sum of all field_tokens_XXX
.ram_bytes
: total RAM occupied by table.disk_bytes
: total disk space, occupied by table.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
: portion of total and cached mappings belonging to document lists.disk_mapped_hitlists
and disk_mapped_cached_hitlists
: portion of total and cached mappings belonging to hit lists. Doclists and hitlists values are shown separately since they're typically large (e.g., about 90% of the whole table's size).killed_documents
and killed_rate
: the first indicates the number of deleted documents and the rate of deleted/indexed. Technically, deleting a document means suppressing it in search output, but it still physically exists in the table and will only be purged after merging/optimizing the table.ram_chunk
: size of the RAM chunk of real-time or percolate table.ram_chunk_segments_count
: RAM chunk is internally composed of segments, typically no more than 32. This line shows the current count.disk_chunks
: number of disk chunks in the real-time table.mem_limit
: actual value of rt_mem_limit
for the table.mem_limit_rate
: the rate at which the RAM chunk will be flushed as a disk chunk, e.g., if rt_mem_limit
is 128M and the rate is 50%, a new disk chunk will be saved when the RAM chunk exceeds 64M.ram_bytes_retired
: represents the size of garbage in RAM chunks (e.g., deleted or replaced documents not yet permanently removed).locked
: a value greater than 0 indicates that the table is currently locked by FREEZE. The number represents how many times the table has been frozen. For instance, a table might be frozen by manticore-backup
and then frozen again by replication. It should only be completely unfrozen when no other process requires it to be frozen.max_stack_need
: stack space we need to calculate most complex from the stored percolate queries. That is dynamic value, depends on build details as compiler, optimization, hardware, etc.average_stack_base
: stack space which is usually occupied on start of calculation of percolate query.desired_thread_stack
: sum of above values, rounded up to 128 bytes edge. If this value is greater than thread_stack
, you may not execute call pq
over this table, as some stored queries will fail. Default thread_stack
value is 1M (which is 1048576); other values should be configured.tid
and tid_saved
: represent the state of saving the table. tid
increases with each change (transaction). tid_saved
shows the max tid
of the state saved in a RAM chunk in <table>.ram
file. When the numbers differ, some changes exist only in RAM and are also backed by binlog (if enabled). Performing FLUSH TABLE
or scheduling periodic flushing saves these changes. After flushing, the binlog is cleared, and tid_saved
represents the new actual state.query_time_*
, exact_query_time_*
: query execution time statistics for the last 1 minute, 5 minutes, 15 minutes, and total since server start; data is encapsulated as a JSON object, including the number of queries and min, max, avg, 95, and 99 percentile values.found_rows_*
: statistics of rows found by queries; provided for the last 1 minute, 5 minutes, 15 minutes, and total since server start; data is encapsulated as a JSON object, including the number of queries and min, max, avg, 95, and 99 percentile values.mysql> SHOW TABLE statistic STATUS;
+-----------------------------+--------------------------------------------------------------------------+
| Variable_name | Value |
+-----------------------------+--------------------------------------------------------------------------+
| index_type | rt |
| indexed_documents | 146000 |
| indexed_bytes | 149504000 |
| ram_bytes | 87674788 |
| disk_bytes | 1762811 |
| disk_mapped | 794147 |
| disk_mapped_cached | 802816 |
| disk_mapped_doclists | 0 |
| disk_mapped_cached_doclists | 0 |
| disk_mapped_hitlists | 0 |
| disk_mapped_cached_hitlists | 0 |
| killed_documents | 0 |
| killed_rate | 0.00% |
| ram_chunk | 86865484 |
| ram_chunk_segments_count | 24 |
| disk_chunks | 1 |
| mem_limit | 134217728 |
| mem_limit_rate | 95.00% |
| ram_bytes_retired | 0 |
| locked | 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":"-"} |
| 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":"-"} |
+-----------------------------+--------------------------------------------------------------------------+
29 rows in set (0.00 sec)
$index->status();
Array(
[index_type] => rt
[indexed_documents] => 3
[indexed_bytes] => 0
[ram_bytes] => 6678
[disk_bytes] => 611
[ram_chunk] => 990
[ram_chunk_segments_count] => 2
[mem_limit] => 134217728
[ram_bytes_retired] => 0
[locked] => 0
[tid] => 15
[query_time_1min] => {"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}
[query_time_5min] => {"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}
[query_time_15min] => {"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}
[query_time_total] => {"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}
[found_rows_1min] => {"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}
[found_rows_5min] => {"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}
[found_rows_15min] => {"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}
[found_rows_total] => {"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}
)
utilsApi.sql('SHOW TABLE statistic STATUS')
{u'columns': [{u'Key': {u'type': u'string'}},
{u'Value': {u'type': u'string'}}],
u'data': [
{u'Key': u'index_type', u'Value': u'rt'}
{u'Key': u'indexed_documents', u'Value': u'3'}
{u'Key': u'indexed_bytes', u'Value': u'0'}
{u'Key': u'ram_bytes', u'Value': u'6678'}
{u'Key': u'disk_bytes', u'Value': u'611'}
{u'Key': u'ram_chunk', u'Value': u'990'}
{u'Key': u'ram_chunk_segments_count', u'Value': u'2'}
{u'Key': u'mem_limit', u'Value': u'134217728'}
{u'Key': u'ram_bytes_retired', u'Value': u'0'}
{u'Key': u'locked', u'Value': u'0'}
{u'Key': u'tid', u'Value': u'15'}
{u'Key': u'query_time_1min', u'Value': u'{"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}'}
{u'Key': u'query_time_5min', u'Value': u'{"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}'}
{u'Key': u'query_time_15min', u'Value': u'{"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}'}
{u'Key': u'query_time_total', u'Value': u'{"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}'}
{u'Key': u'found_rows_1min', u'Value': u'{"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}'}
{u'Key': u'found_rows_5min', u'Value': u'{"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}'}
{u'Key': u'found_rows_15min', u'Value': u'{"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}'}
{u'Key': u'found_rows_total', u'Value': u'{"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}'}],
u'error': u'',
u'total': 0,
u'warning': u''}
res = await utilsApi.sql('SHOW TABLE statistic STATUS');
{"columns": [{"Key": {"type": "string"}},
{"Value": {"type": "string"}}],
"data": [
{"Key": "index_type", "Value": "rt"}
{"Key": "indexed_documents", "Value": "3"}
{"Key": "indexed_bytes", "Value": "0"}
{"Key": "ram_bytes", "Value": "6678"}
{"Key": "disk_bytes", "Value": "611"}
{"Key": "ram_chunk", "Value": "990"}
{"Key": "ram_chunk_segments_count", "Value": "2"}
{"Key": "mem_limit", "Value": "134217728"}
{"Key": "ram_bytes_retired", "Value": "0"}
{"Key": "locked", "Value": "0"}
{"Key": "tid", "Value": "15"}
{"Key": "query_time_1min", "Value": "{"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}"}
{"Key": "query_time_5min", "Value": "{"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}"}
{"Key": "query_time_15min", "Value": "{"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}"}
{"Key": "query_time_total", "Value": "{"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}"}
{"Key": "found_rows_1min", "Value": "{"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}"}
{"Key": "found_rows_5min", "Value": "{"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}"}
{"Key": "found_rows_15min", "Value": "{"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}"}
{"Key": "found_rows_total", "Value": "{"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}"}],
"error": "",
"total": 0,
"warning": ""}
utilsApi.sql("SHOW TABLE statistic STATUS");
{columns=[{ Key : { type=string }},
{ Value : { type=string }}],
data : [
{ Key=index_type, Value=rt}
{ Key=indexed_documents, Value=3}
{ Key=indexed_bytes, Value=0}
{ Key=ram_bytes, Value=6678}
{ Key=disk_bytes, Value=611}
{ Key=ram_chunk, Value=990}
{ Key=ram_chunk_segments_count, Value=2}
{ Key=mem_limit, Value=134217728}
{ Key=ram_bytes_retired, Value=0}
{ Key=locked, Value=0}
{ Key=tid, Value=15}
{ Key=query_time_1min, Value={queries:1, avg_sec:0.001, min_sec:0.001, max_sec:0.001, pct95_sec:0.001, pct99_sec:0.001}}
{ Key=query_time_5min, Value={queries:1, avg_sec:0.001, min_sec:0.001, max_sec:0.001, pct95_sec:0.001, pct99_sec:0.001}}
{ Key=query_time_15min, Value={queries:1, avg_sec:0.001, min_sec:0.001, max_sec:0.001, pct95_sec:0.001, pct99_sec:0.001}}
{ Key=query_time_total, Value={queries:1, avg_sec:0.001, min_sec:0.001, max_sec:0.001, pct95_sec:0.001, pct99_sec:0.001}}
{ Key=found_rows_1min, Value={queries:1, avg:3, min:3, max:3, pct95:3, pct99:3}}
{ Key=found_rows_5min, Value={queries:1, avg:3, min:3, max:3, pct95:3, pct99:3}}
{ Key=found_rows_15min, Value={queries:1, avg:3, min:3, max:3, pct95:3, pct99:3}}
{ Key=found_rows_total, Value={queries:1, avg:3, min:3, max:3, pct95:3, pct99:3}}],
error= ,
total=0,
warning= }
utilsApi.Sql("SHOW TABLE statistic STATUS");
{columns=[{ Key : { type=string }},
{ Value : { type=string }}],
data : [
{ Key=index_type, Value=rt}
{ Key=indexed_documents, Value=3}
{ Key=indexed_bytes, Value=0}
{ Key=ram_bytes, Value=6678}
{ Key=disk_bytes, Value=611}
{ Key=ram_chunk, Value=990}
{ Key=ram_chunk_segments_count, Value=2}
{ Key=mem_limit, Value=134217728}
{ Key=ram_bytes_retired, Value=0}
{ Key=locked, Value=0}
{ Key=tid, Value=15}
{ Key=query_time_1min, Value={queries:1, avg_sec:0.001, min_sec:0.001, max_sec:0.001, pct95_sec:0.001, pct99_sec:0.001}}
{ Key=query_time_5min, Value={queries:1, avg_sec:0.001, min_sec:0.001, max_sec:0.001, pct95_sec:0.001, pct99_sec:0.001}}
{ Key=query_time_15min, Value={queries:1, avg_sec:0.001, min_sec:0.001, max_sec:0.001, pct95_sec:0.001, pct99_sec:0.001}}
{ Key=query_time_total, Value={queries:1, avg_sec:0.001, min_sec:0.001, max_sec:0.001, pct95_sec:0.001, pct99_sec:0.001}}
{ Key=found_rows_1min, Value={queries:1, avg:3, min:3, max:3, pct95:3, pct99:3}}
{ Key=found_rows_5min, Value={queries:1, avg:3, min:3, max:3, pct95:3, pct99:3}}
{ Key=found_rows_15min, Value={queries:1, avg:3, min:3, max:3, pct95:3, pct99:3}}
{ Key=found_rows_total, Value={queries:1, avg:3, min:3, max:3, pct95:3, pct99:3}}],
error="" ,
total=0,
warning="" }
res = await utilsApi.sql('SHOW TABLE statistic STATUS');
{
"columns":
[{
"Key": {"type": "string"}
},
{
"Value": {"type": "string"}
}],
"data":
[
{"Key": "index_type", "Value": "rt"}
{"Key": "indexed_documents", "Value": "3"}
{"Key": "indexed_bytes", "Value": "0"}
{"Key": "ram_bytes", "Value": "6678"}
{"Key": "disk_bytes", "Value": "611"}
{"Key": "ram_chunk", "Value": "990"}
{"Key": "ram_chunk_segments_count", "Value": "2"}
{"Key": "mem_limit", "Value": "134217728"}
{"Key": "ram_bytes_retired", "Value": "0"}
{"Key": "locked", "Value": "0"}
{"Key": "tid", "Value": "15"}
{"Key": "query_time_1min", "Value": "{"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}"}
{"Key": "query_time_5min", "Value": "{"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}"}
{"Key": "query_time_15min", "Value": "{"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}"}
{"Key": "query_time_total", "Value": "{"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}"}
{"Key": "found_rows_1min", "Value": "{"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}"}
{"Key": "found_rows_5min", "Value": "{"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}"}
{"Key": "found_rows_15min", "Value": "{"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}"}
{"Key": "found_rows_total", "Value": "{"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}"}
],
"error": "",
"total": 0,
"warning": ""
}
apiClient.UtilsAPI.Sql(context.Background()).Body("SHOW TABLE statistic STATUS").Execute()
{
"columns":
[{
"Key": {"type": "string"}
},
{
"Value": {"type": "string"}
}],
"data":
[
{"Key": "index_type", "Value": "rt"}
{"Key": "indexed_documents", "Value": "3"}
{"Key": "indexed_bytes", "Value": "0"}
{"Key": "ram_bytes", "Value": "6678"}
{"Key": "disk_bytes", "Value": "611"}
{"Key": "ram_chunk", "Value": "990"}
{"Key": "ram_chunk_segments_count", "Value": "2"}
{"Key": "mem_limit", "Value": "134217728"}
{"Key": "ram_bytes_retired", "Value": "0"}
{"Key": "locked", "Value": "0"}
{"Key": "tid", "Value": "15"}
{"Key": "query_time_1min", "Value": "{"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}"}
{"Key": "query_time_5min", "Value": "{"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}"}
{"Key": "query_time_15min", "Value": "{"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}"}
{"Key": "query_time_total", "Value": "{"queries":1, "avg_sec":0.001, "min_sec":0.001, "max_sec":0.001, "pct95_sec":0.001, "pct99_sec":0.001}"}
{"Key": "found_rows_1min", "Value": "{"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}"}
{"Key": "found_rows_5min", "Value": "{"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}"}
{"Key": "found_rows_15min", "Value": "{"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}"}
{"Key": "found_rows_total", "Value": "{"queries":1, "avg":3, "min":3, "max":3, "pct95":3, "pct99":3}"}
],
"error": "",
"total": 0,
"warning": ""
}
SHOW TABLE SETTINGS
is an SQL statement that displays per-table settings in a format compatible with the config file.
The syntax is:
SHOW TABLE index_name[.N | CHUNK N] SETTINGS
The output resembles the --dumpconfig option of the indextool utility. The report provides a breakdown of all table settings, including tokenizer and dictionary options.
SHOW TABLE forum SETTINGS;
+---------------+-----------------------------------------------------------------------------------------------------------+
| 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 can also specify a particular chunk number to view the settings of a specific chunk in an RT table. The numbering is 0-based.
SHOW TABLE forum CHUNK 0 SETTINGS;
+---------------+-----------------------------------------------------------------------------------------------------------+
| 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)