You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@iotdb.apache.org by Xiangwei Wei <wx...@gmail.com> on 2020/12/01 07:05:04 UTC

Re: The design doc of [IOTDB-965] add timeout in query

As discussed before, I modified the design doc[1].

Mainly updated:

1. Abstract and implement two more methods:
 (1) Check the query running now. Refer to Mysql, the sql is like `show
query processlist`, whose dataset is like:
  | QueryId |        StartTime             | SQL
        |
  | ----------- | ----------------------------- |
----------------------------------- |
  | 2            | 2020-12-01T14:37:00 | select * from root.sg.device1; |
 (2) Cancel the query based on queryId. The sql is like  kill query N  , in
which N represents the queryId.

2. Set timeout parameter in JDBC and Session query.


For more details, please check [1]~

[1]
https://cwiki.apache.org/confluence/display/IOTDB/Query+over+time+design+doc

Xiangwei Wei <wx...@gmail.com> 于2020年11月27日周五 下午3:00写道:

> Hi all,
>
> Thanks for your response~
>
> > Query time out should be defined at query level, or at least session
> level.
>
> Big +1 for that. We can provide a new method to set timeout by JDBC and
> session. And provide one local timeout parameter when executing query
> statement.
>
>
> > This would best be based query cancellation, i.e., a query can be
> cancelled by a given interface
>
> It will be fine. I will try to abstract it.
>
> Jialin Qiao <qj...@mails.tsinghua.edu.cn> 于2020年11月27日周五 下午1:03写道:
>
>> Hi,
>>
>> +1 for setting timeout in query and abstracting the cancel interface
>>
>> Thanks,
>> --
>> Jialin Qiao
>> School of Software, Tsinghua University
>>
>> 乔嘉林
>> 清华大学 软件学院
>>
>> &gt; -----原始邮件-----
>> &gt; 发件人: "Houliang Qi" <ne...@163.com>
>> &gt; 发送时间: 2020-11-27 10:23:24 (星期五)
>> &gt; 收件人: "dev@iotdb.apache.org" <de...@iotdb.apache.org>
>> &gt; 抄送:
>> &gt; 主题: Re: The design doc of [IOTDB-965] add timeout in query
>> &gt;
>> &gt; Hi,
>> &gt;
>> &gt;
>> &gt; +1 for Tian Jiang ideas,
>> &gt; And I think we can extend the session api to add one parameter to
>> indicate the operation timeouts(insert、query and so on), besides we can
>> implement the `setQueryTimeout()` method in JDBC.
>> &gt;
>> &gt;
>> &gt; Thanks,
>> &gt; ---------------------------------------
>> &gt; Houliang Qi
>> &gt; BONC, Ltd
>> &gt; On 11/27/2020 09:55,Tian Jiang<jt...@163.com> wrote:
>> &gt; Greetings,
>> &gt;
>> &gt;
>> &gt; This is important indeed, but I have some suggestions:
>> &gt; 1. This would best be based query cancellation, i.e., a query can be
>> cancelled by a given interface, and the timed thread need only to call this
>> interface to time out a query when needed. The merit of doing so is better
>> abstraction and then we can readily implement `cancel()` in JDBC.
>> &gt;
>> &gt;
>> &gt; 2. Query time out should be defined at query level, or at least
>> session level. Users may often be running different types of queries at the
>> same time, like short monitoring queries (milliseconds to seconds) and long
>> analytic queries (hours to days), defining only one global timeout is
>> seldom enough for complex applications.
>> &gt;
>> &gt;
>> &gt; Best
>> &gt; Tian Jiang
>> &gt; On 11/26/2020 21:32,Xiangwei Wei<wx...@gmail.com> wrote:
>> &gt; If a query takes too much time, we'd better interrupt this query
>> instead of
>> &gt; hanging up the client.
>> &gt;
>> &gt; The design doc is in [1]. Any advice is appreciated :D
>> &gt;
>> &gt; A discussion is:
>> &gt; How long can the query be considered as time out? maybe 5min, 10min?
>> We
>> &gt; need to set a default value, of course it can be modified by the
>> user.
>> &gt;
>> &gt; [1]
>> &gt;
>> https://cwiki.apache.org/confluence/display/IOTDB/Query+over+time+design+doc
>> &gt
>> <https://cwiki.apache.org/confluence/display/IOTDB/Query+over+time+design+doc&gt>;
>>
>> &gt; --
>> &gt; Best,
>> &gt; Xiangwei Wei
>> </w...@iotdb.apache.org></
>> neuyilan@163.com>
>
>
>
> --
> Best,
> Xiangwei Wei
>


-- 
Best,
Xiangwei Wei