首页 > 解决方案 > 如何在 TDengine 上查看查询状态?

问题描述

我正在使用 TDengine 部署多个节点的集群。在我创建了 ~10000 个表并尝试在我的一台主机上执行如下所示的复杂 sql 之后,查询完成需要相当长的时间。我想知道当当前外壳挂起时,是否有办法检查来自另一台主机的查询(即从哪个主机发送的查询等)的状态。

taos> select count(*),first(ts),last(ts), sum(current) from meters interval(100a) group by tbname;
           ts            |       count(*)        |        first(ts)        |        last(ts)         |       sum(current)        |             tbname             |
===================================================================================================================================================================
 2017-07-14 10:40:00.000 |                   100 | 2017-07-14 10:40:00.000 | 2017-07-14 10:40:00.099 |             996.587355614 | d0                             |
 2017-07-14 10:40:00.100 |                   100 | 2017-07-14 10:40:00.100 | 2017-07-14 10:40:00.199 |             997.835609436 | d0                             |
 2017-07-14 10:40:00.200 |                   100 | 2017-07-14 10:40:00.200 | 2017-07-14 10:40:00.299 |             998.551523209 | d0                             |
 2017-07-14 10:40:00.300 |                   100 | 2017-07-14 10:40:00.300 | 2017-07-14 10:40:00.399 |             999.269976616 | d0                             |
 2017-07-14 10:40:00.400 |                   100 | 2017-07-14 10:40:00.400 | 2017-07-14 10:40:00.499 |             999.230366707 | d0                             |
 2017-07-14 10:40:00.500 |                   100 | 2017-07-14 10:40:00.500 | 2017-07-14 10:40:00.599 |             996.629768372 | d0                             |
 2017-07-14 10:40:00.600 |                   100 | 2017-07-14 10:40:00.600 | 2017-07-14 10:40:00.699 |             996.427525520 | d0                             |
 2017-07-14 10:40:00.700 |                   100 | 2017-07-14 10:40:00.700 | 2017-07-14 10:40:00.799 |             997.461921692 | d0                             |
 2017-07-14 10:40:00.800 |                   100 | 2017-07-14 10:40:00.800 | 2017-07-14 10:40:00.899 |             997.587766647 | d0                             |
 2017-07-14 10:40:00.900 |                   100 | 2017-07-14 10:40:00.900 | 2017-07-14 10:40:00.999 |             998.667234421 | d0                             |
 2017-07-14 10:40:01.000 |                   100 | 2017-07-14 10:40:01.000 | 2017-07-14 10:40:01.099 |             997.393896103 | d0                             |

....

          100 | 2017-07-14 10:40:09.200 | 2017-07-14 10:40:09.299 |             998.651506424 | d0                             |
 2017-07-14 10:40:09.300 |                   100 | 2017-07-14 10:40:09.300 | 2017-07-14 10:40:09.399 |             996.747236252 | d0                             |
 2017-07-14 10:40:09.400 |                   100 | 2017-07-14 10:40:09.400 | 2017-07-14 10:40:09.499 |             999.305024147 | d0                             |
 2017-07-14 10:40:09.500 |                   100 | 2017-07-14 10:40:09.500 | 2017-07-14 10:40:09.599 |             997.183553696 | d0                             |
 2017-07-14 10:40:09.600 |                   100 | 2017-07-14 10:40:09.600 | 2017-07-14 10:40:09.699 |             999.539278984 | d0                             |
 2017-07-14 10:40:09.700 |                   100 | 2017-07-14 10:40:09.700 | 2017-07-14 10:40:09.799 |             998.831772804 | d0                             |
 2017-07-14 10:40:09.800 |                   100 | 2017-07-14 10:40:09.800 | 2017-07-14 10:40:09.899 |             995.791324615 | d0                             |
 2017-07-14 10:40:09.900 |                   100 | 2017-07-14 10:40:09.900 | 2017-07-14 10:40:09.999 |             997.620196342 | d0                             |
[100 Rows showed, and more rows are fetching but will not be showed. You can ctrl+c to stop or wait.]
[You can add limit statement to show more or redirect results to specific file to get all.]
Query OK, 1000000 row(s) in set (32.192185s)

标签: sqlcluster-computingtd-engine

解决方案


您可以使用 SQL 命令“SHOW QUERIES;”来查找更多信息。


推荐阅读