Search code examples
tdengine

how to completely stop a continuous query in TDengine database?


I created a continuous query in TDengine database by following the example in official website as follows:

taos> create table meters (ts timestamp, current float, voltage int, phase float) tags (location binary(64), groupId int);
Query OK, 0 of 0 row(s) in database (0.002309s)

taos> create table D1001 using meters tags ("Beijing.Chaoyang", 2);
Query OK, 0 of 0 row(s) in database (0.002737s)

taos> create table D1002 using meters tags ("Beijing.Haidian", 2);
Query OK, 0 of 0 row(s) in database (0.004740s)

taos> create table avg_vol as select avg(voltage) from meters interval(1m) sliding(30s);
Query OK, 0 of 0 row(s) in database (0.005207s)

taos> show streams;
       streamId       |           user           |           dest table           |        ip:port         |      created time       |        exec time        |       time(us)        |              sql               |   cycles    |
=======================================================================================================================================================================================================================================
 3:1                  | _root                    | avg_vol                        | 127.0.0.1:37643        | 2022-01-21 16:20:32.538 | NULL                    |                     0 | select avg(voltage) from me... |           0 |
Query OK, 1 row(s) in set (0.002328s)

taos> kill stream 3:1;
Query OK, 0 row(s) in set (0.000418s)

taos> show streams;
Query OK, 0 row(s) in set (0.001015s)

It looks good, but when I restart the database, I still see this continuous query, how to kill it completely?


Solution

  • try drop the destination table you created

    drop table avg_vol;