blob: c0e550d63a49344f32591598fef253ce4e4a0440 [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[71],{636:function(e,s,t){"use strict";t.r(s);var n=t(68),a=Object(n.a)({},(function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"sdt"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#sdt"}},[e._v("#")]),e._v(" SDT")]),e._v(" "),t("p",[e._v("The Swinging Door Trending (SDT) algorithm is a lossy compression algorithm.\nSDT has low computational complexity and uses a linear trend to represent a quantity of data.")]),e._v(" "),t("p",[e._v("In IoTDB SDT compresses and discards data when flushing into the disk.")]),e._v(" "),t("p",[e._v("IoTDB allows you to specify the properties of SDT when creating a time series, and supports three properties:")]),e._v(" "),t("ul",[t("li",[e._v("CompDev (Compression Deviation)")])]),e._v(" "),t("p",[e._v("CompDev is the most important parameter in SDT that represents the maximum difference between the current sample and the current linear trend.")]),e._v(" "),t("ul",[t("li",[e._v("CompMin (Compression Minimum)")])]),e._v(" "),t("p",[e._v("CompMin is used for noisy reduction. CompMin measures the time distance between two stored data points,\nif the current point's time to the last stored point's time distance is smaller than or equal to compMin,\ncurrent point will NOT be stored regardless of compression deviation.")]),e._v(" "),t("ul",[t("li",[e._v("CompMax (Compression Maximum)")])]),e._v(" "),t("p",[e._v("CompMax is used to periodically check the time distance between the last stored point to the current point.\nIt measures the time difference between stored points. If the current point time to the last\nstored point's time distance is greater than or equal to compMax, current point will be stored regardless of compression deviation.")]),e._v(" "),t("p",[e._v("The specified syntax for SDT is detailed in "),t("RouterLink",{attrs:{to:"/UserGuide/Master/Operation Manual/SQL Reference.html"}},[e._v("Create Timeseries Statement")]),e._v(".")],1),e._v(" "),t("p",[e._v("Supported datatypes:")]),e._v(" "),t("ul",[t("li",[e._v("INT32 (Integer)")]),e._v(" "),t("li",[e._v("INT64 (Long Integer)")]),e._v(" "),t("li",[e._v("FLOAT (Single Precision Floating Point)")]),e._v(" "),t("li",[e._v("DOUBLE (Double Precision Floating Point)")])]),e._v(" "),t("p",[e._v("The following is an example of using SDT compression.")]),e._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("IoTDB> CREATE TIMESERIES root.sg1.d0.s0 WITH DATATYPE=INT32,ENCODING=PLAIN,LOSS=SDT,COMPDEV=2\n")])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br")])]),t("p",[e._v("Prior to flushing and SDT compression, the results are shown below:")]),e._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("IoTDB> SELECT s0 FROM root.sg1.d0\n+-----------------------------+--------------+\n| Time|root.sg1.d0.s0|\n+-----------------------------+--------------+\n|2017-11-01T00:06:00.001+08:00| 1|\n|2017-11-01T00:06:00.002+08:00| 1|\n|2017-11-01T00:06:00.003+08:00| 1|\n|2017-11-01T00:06:00.004+08:00| 1|\n|2017-11-01T00:06:00.005+08:00| 1|\n|2017-11-01T00:06:00.006+08:00| 1|\n|2017-11-01T00:06:00.007+08:00| 1|\n|2017-11-01T00:06:00.015+08:00| 10|\n|2017-11-01T00:06:00.016+08:00| 20|\n|2017-11-01T00:06:00.017+08:00| 1|\n|2017-11-01T00:06:00.018+08:00| 30|\n+-----------------------------+--------------+\nTotal line number = 11\nIt costs 0.008s\n")])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br"),t("span",{staticClass:"line-number"},[e._v("2")]),t("br"),t("span",{staticClass:"line-number"},[e._v("3")]),t("br"),t("span",{staticClass:"line-number"},[e._v("4")]),t("br"),t("span",{staticClass:"line-number"},[e._v("5")]),t("br"),t("span",{staticClass:"line-number"},[e._v("6")]),t("br"),t("span",{staticClass:"line-number"},[e._v("7")]),t("br"),t("span",{staticClass:"line-number"},[e._v("8")]),t("br"),t("span",{staticClass:"line-number"},[e._v("9")]),t("br"),t("span",{staticClass:"line-number"},[e._v("10")]),t("br"),t("span",{staticClass:"line-number"},[e._v("11")]),t("br"),t("span",{staticClass:"line-number"},[e._v("12")]),t("br"),t("span",{staticClass:"line-number"},[e._v("13")]),t("br"),t("span",{staticClass:"line-number"},[e._v("14")]),t("br"),t("span",{staticClass:"line-number"},[e._v("15")]),t("br"),t("span",{staticClass:"line-number"},[e._v("16")]),t("br"),t("span",{staticClass:"line-number"},[e._v("17")]),t("br"),t("span",{staticClass:"line-number"},[e._v("18")]),t("br")])]),t("p",[e._v("After flushing and SDT compression, the results are shown below:")]),e._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("IoTDB> FLUSH\nIoTDB> SELECT s0 FROM root.sg1.d0\n+-----------------------------+--------------+\n| Time|root.sg1.d0.s0|\n+-----------------------------+--------------+\n|2017-11-01T00:06:00.001+08:00| 1|\n|2017-11-01T00:06:00.007+08:00| 1|\n|2017-11-01T00:06:00.015+08:00| 10|\n|2017-11-01T00:06:00.016+08:00| 20|\n|2017-11-01T00:06:00.017+08:00| 1|\n+-----------------------------+--------------+\nTotal line number = 5\nIt costs 0.044s\n")])]),e._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[e._v("1")]),t("br"),t("span",{staticClass:"line-number"},[e._v("2")]),t("br"),t("span",{staticClass:"line-number"},[e._v("3")]),t("br"),t("span",{staticClass:"line-number"},[e._v("4")]),t("br"),t("span",{staticClass:"line-number"},[e._v("5")]),t("br"),t("span",{staticClass:"line-number"},[e._v("6")]),t("br"),t("span",{staticClass:"line-number"},[e._v("7")]),t("br"),t("span",{staticClass:"line-number"},[e._v("8")]),t("br"),t("span",{staticClass:"line-number"},[e._v("9")]),t("br"),t("span",{staticClass:"line-number"},[e._v("10")]),t("br"),t("span",{staticClass:"line-number"},[e._v("11")]),t("br"),t("span",{staticClass:"line-number"},[e._v("12")]),t("br"),t("span",{staticClass:"line-number"},[e._v("13")]),t("br")])]),t("p",[e._v("SDT takes effect when flushing to the disk. The SDT algorithm always stores the first point and does not store the last point.")]),e._v(" "),t("p",[e._v("The data in [2017-11-01T00:06:00.001, 2017-11-01T00:06:00.007] is within the compression deviation thus discarded.\nThe data point at time 2017-11-01T00:06:00.007 is stored because the next data point at time 2017-11-01T00:06:00.015\nexceeds compression deviation. When a data point exceeds the compression deviation, SDT stores the last read\npoint and updates the upper and lower boundaries. The last point at time 2017-11-01T00:06:00.018 is not stored.")])])}),[],!1,null,null,null);s.default=a.exports}}]);