blob: 8631b0ed54e9d3c73c03566bbbdb5a02edbfa459 [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[86],{649:function(e,t,s){"use strict";s.r(t);var a=s(69),r=Object(a.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"kill-query"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#kill-query"}},[e._v("#")]),e._v(" Kill Query")]),e._v(" "),s("p",[e._v("When using IoTDB, you may encounter the following situations: you have entered a query statement, but can not get the result for a long time, as this query contains too much data or some other reasons, and have to wait until the query ends.\nSince version 0.12, IoTDB has provided two solutions for queries with long execution time: query timeout and query abort.")]),e._v(" "),s("h2",{attrs:{id:"query-timeout"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#query-timeout"}},[e._v("#")]),e._v(" Query timeout")]),e._v(" "),s("p",[e._v("For queries that take too long to execute, IoTDB will forcibly interrupt the query and throw a timeout exception, as shown in the figure:")]),e._v(" "),s("p",[s("img",{attrs:{src:"https://user-images.githubusercontent.com/34242296/104586593-a224aa00-56a0-11eb-9c52-241dcdb68ecb.png",alt:"image"}})]),e._v(" "),s("p",[e._v("The default timeout of the system is 60000 ms,which can be customized in the configuration file through the "),s("code",[e._v("query_timeout_threshold")]),e._v(" parameter.")]),e._v(" "),s("p",[e._v("If you use JDBC or Session, we also support setting a timeout for a single query(Unit: ms):")]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("E.g. ((IoTDBStatement) statement).executeQuery(String sql, long timeoutInMS)\nE.g. session.executeQueryStatement(String sql, long timeout)\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br"),s("span",{staticClass:"line-number"},[e._v("2")]),s("br")])]),s("p",[e._v("If the timeout parameter is not configured or with value 0, the default timeout time will be used.")]),e._v(" "),s("h2",{attrs:{id:"query-abort"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#query-abort"}},[e._v("#")]),e._v(" Query abort")]),e._v(" "),s("p",[e._v("In addition to waiting for the query to time out passively, IoTDB also supports stopping the query actively:")]),e._v(" "),s("div",{staticClass:"language- line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("KILL QUERY <queryId>\n")])]),e._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[e._v("1")]),s("br")])]),s("p",[e._v("You can abort the specified query by specifying "),s("code",[e._v("queryId")]),e._v(". If "),s("code",[e._v("queryId")]),e._v(" is not specified, all executing queries will be killed.")]),e._v(" "),s("p",[e._v("To get the executing "),s("code",[e._v("queryId")]),e._v(",you can use the "),s("code",[e._v("show query processlist")]),e._v(" command,which will show the list of all executing queries,with the following result set:")]),e._v(" "),s("table",[s("thead",[s("tr",[s("th",[e._v("Time")]),e._v(" "),s("th",[e._v("queryId")]),e._v(" "),s("th",[e._v("statement")])])]),e._v(" "),s("tbody",[s("tr",[s("td"),e._v(" "),s("td"),e._v(" "),s("td")])])]),e._v(" "),s("p",[e._v("The maximum display length of statement is 64 characters. For statements with more than 64 characters, the intercepted part will be displayed.")])])}),[],!1,null,null,null);t.default=r.exports}}]);