blob: af21c5290be1627d1c04cb73926375193ec285db [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[81],{479:function(s,e,t){"use strict";t.r(e);var a=t(29),n=Object(a.a)({},(function(){var s=this,e=s._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[e("h1",{attrs:{id:"storage-group-management"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#storage-group-management"}},[s._v("#")]),s._v(" Storage Group Management")]),s._v(" "),e("h2",{attrs:{id:"create-storage-group"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-storage-group"}},[s._v("#")]),s._v(" Create Storage Group")]),s._v(" "),e("p",[s._v("According to the storage model we can set up the corresponding storage group. Two SQL statements are supported for creating storage groups, as follows:")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("IoTDB > set storage group to root.ln\nIoTDB > create storage group root.sgcc\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br")])]),e("p",[s._v("We can thus create two storage groups using the above two SQL statements.")]),s._v(" "),e("p",[s._v("It is worth noting that when the path itself or the parent/child layer of the path is already set as a storage group, the path is then not allowed to be set as a storage group. For example, it is not feasible to set "),e("code",[s._v("root.ln.wf01")]),s._v(" as a storage group when two storage groups "),e("code",[s._v("root.ln")]),s._v(" and "),e("code",[s._v("root.sgcc")]),s._v(" exist. The system gives the corresponding error prompt as shown below:")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("IoTDB> set storage group to root.ln.wf01\nMsg: 300: root.ln has already been set to storage group.\nIoTDB> create storage group root.ln.wf01\nMsg: 300: root.ln has already been set to storage group.\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br"),e("span",{staticClass:"line-number"},[s._v("4")]),e("br")])]),e("p",[s._v("The LayerName of storage group can only be characters, numbers, underscores and hyphens.")]),s._v(" "),e("p",[s._v("Besides, if deploy on Windows system, the LayerName is case-insensitive, which means it's not allowed to set storage groups "),e("code",[s._v("root.ln")]),s._v(" and "),e("code",[s._v("root.LN")]),s._v(" at the same time.")]),s._v(" "),e("h2",{attrs:{id:"show-storage-group"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#show-storage-group"}},[s._v("#")]),s._v(" Show Storage Group")]),s._v(" "),e("p",[s._v("After creating the storage group, we can use the "),e("RouterLink",{attrs:{to:"/UserGuide/Master/Reference/SQL-Reference.html"}},[s._v("SHOW STORAGE GROUP")]),s._v(" statement and "),e("RouterLink",{attrs:{to:"/UserGuide/Master/Reference/SQL-Reference.html"}},[s._v("SHOW STORAGE GROUP <PathPattern>")]),s._v(" to view the storage groups. The SQL statements are as follows:")],1),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("IoTDB> show storage group\nIoTDB> show storage group root.**\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br")])]),e("p",[s._v("The result is as follows:")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("+-------------+\n|storage group|\n+-------------+\n| root.sgcc|\n| root.ln|\n+-------------+\nTotal line number = 2\nIt costs 0.060s\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br"),e("span",{staticClass:"line-number"},[s._v("4")]),e("br"),e("span",{staticClass:"line-number"},[s._v("5")]),e("br"),e("span",{staticClass:"line-number"},[s._v("6")]),e("br"),e("span",{staticClass:"line-number"},[s._v("7")]),e("br"),e("span",{staticClass:"line-number"},[s._v("8")]),e("br")])]),e("h2",{attrs:{id:"delete-storage-group"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#delete-storage-group"}},[s._v("#")]),s._v(" Delete Storage Group")]),s._v(" "),e("p",[s._v("User can use the "),e("code",[s._v("DELETE STORAGE GROUP <PathPattern>")]),s._v(" statement to delete all storage groups matching the pathPattern. Please note the data in the storage group will also be deleted.")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("IoTDB > DELETE STORAGE GROUP root.ln\nIoTDB > DELETE STORAGE GROUP root.sgcc\n// delete all data, all timeseries and all storage groups\nIoTDB > DELETE STORAGE GROUP root.**\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br"),e("span",{staticClass:"line-number"},[s._v("4")]),e("br")])]),e("h2",{attrs:{id:"count-storage-group"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#count-storage-group"}},[s._v("#")]),s._v(" Count Storage Group")]),s._v(" "),e("p",[s._v("User can use the "),e("code",[s._v("COUNT STORAGE GROUP <PathPattern>")]),s._v(" statement to count the number of storage groups. It is allowed to specify "),e("code",[s._v("PathPattern")]),s._v(" to count the number of storage groups matching the "),e("code",[s._v("PathPattern")]),s._v(".")]),s._v(" "),e("p",[s._v("SQL statement is as follows:")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("IoTDB> show storage group\nIoTDB> count storage group\nIoTDB> count storage group root.*\nIoTDB> count storage group root.sgcc.*\nIoTDB> count storage group root.sgcc\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br"),e("span",{staticClass:"line-number"},[s._v("4")]),e("br"),e("span",{staticClass:"line-number"},[s._v("5")]),e("br")])]),e("p",[s._v("The result is as follows:")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("+-------------+\n|storage group|\n+-------------+\n| root.sgcc|\n| root.turbine|\n| root.ln|\n+-------------+\nTotal line number = 3\nIt costs 0.003s\n\n+-------------+\n|storage group|\n+-------------+\n| 3|\n+-------------+\nTotal line number = 1\nIt costs 0.003s\n\n+-------------+\n|storage group|\n+-------------+\n| 3|\n+-------------+\nTotal line number = 1\nIt costs 0.002s\n\n+-------------+\n|storage group|\n+-------------+\n| 0|\n+-------------+\nTotal line number = 1\nIt costs 0.002s\n\n+-------------+\n|storage group|\n+-------------+\n| 1|\n+-------------+\nTotal line number = 1\nIt costs 0.002s\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br"),e("span",{staticClass:"line-number"},[s._v("4")]),e("br"),e("span",{staticClass:"line-number"},[s._v("5")]),e("br"),e("span",{staticClass:"line-number"},[s._v("6")]),e("br"),e("span",{staticClass:"line-number"},[s._v("7")]),e("br"),e("span",{staticClass:"line-number"},[s._v("8")]),e("br"),e("span",{staticClass:"line-number"},[s._v("9")]),e("br"),e("span",{staticClass:"line-number"},[s._v("10")]),e("br"),e("span",{staticClass:"line-number"},[s._v("11")]),e("br"),e("span",{staticClass:"line-number"},[s._v("12")]),e("br"),e("span",{staticClass:"line-number"},[s._v("13")]),e("br"),e("span",{staticClass:"line-number"},[s._v("14")]),e("br"),e("span",{staticClass:"line-number"},[s._v("15")]),e("br"),e("span",{staticClass:"line-number"},[s._v("16")]),e("br"),e("span",{staticClass:"line-number"},[s._v("17")]),e("br"),e("span",{staticClass:"line-number"},[s._v("18")]),e("br"),e("span",{staticClass:"line-number"},[s._v("19")]),e("br"),e("span",{staticClass:"line-number"},[s._v("20")]),e("br"),e("span",{staticClass:"line-number"},[s._v("21")]),e("br"),e("span",{staticClass:"line-number"},[s._v("22")]),e("br"),e("span",{staticClass:"line-number"},[s._v("23")]),e("br"),e("span",{staticClass:"line-number"},[s._v("24")]),e("br"),e("span",{staticClass:"line-number"},[s._v("25")]),e("br"),e("span",{staticClass:"line-number"},[s._v("26")]),e("br"),e("span",{staticClass:"line-number"},[s._v("27")]),e("br"),e("span",{staticClass:"line-number"},[s._v("28")]),e("br"),e("span",{staticClass:"line-number"},[s._v("29")]),e("br"),e("span",{staticClass:"line-number"},[s._v("30")]),e("br"),e("span",{staticClass:"line-number"},[s._v("31")]),e("br"),e("span",{staticClass:"line-number"},[s._v("32")]),e("br"),e("span",{staticClass:"line-number"},[s._v("33")]),e("br"),e("span",{staticClass:"line-number"},[s._v("34")]),e("br"),e("span",{staticClass:"line-number"},[s._v("35")]),e("br"),e("span",{staticClass:"line-number"},[s._v("36")]),e("br"),e("span",{staticClass:"line-number"},[s._v("37")]),e("br"),e("span",{staticClass:"line-number"},[s._v("38")]),e("br"),e("span",{staticClass:"line-number"},[s._v("39")]),e("br"),e("span",{staticClass:"line-number"},[s._v("40")]),e("br"),e("span",{staticClass:"line-number"},[s._v("41")]),e("br")])])])}),[],!1,null,null,null);e.default=n.exports}}]);