You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sk...@apache.org on 2021/11/10 13:54:45 UTC

[ignite] branch master updated: IGNITE-15134 Added documentation for SQL statistics functionality. Fixes #9556

This is an automated email from the ASF dual-hosted git repository.

sk0x50 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 2e649da  IGNITE-15134 Added documentation for SQL statistics functionality. Fixes #9556
2e649da is described below

commit 2e649dae6998ddd6d7ca62f397dab4df64a9de44
Author: IgGusev <de...@mail.ru>
AuthorDate: Wed Nov 10 16:54:10 2021 +0300

    IGNITE-15134 Added documentation for SQL statistics functionality. Fixes #9556
    
    Signed-off-by: Slava Koptilin <sl...@gmail.com>
---
 docs/_data/toc.yaml                             |   2 +
 docs/_docs/SQL/sql-statistics.adoc              | 182 +++++++++++++++++++++++
 docs/_docs/images/svg/analyze_bnf1.svg          | 188 ++++++++++++++++++++++++
 docs/_docs/images/svg/analyze_bnf2.svg          | 168 +++++++++++++++++++++
 docs/_docs/images/svg/drop_bnf.svg              | 188 ++++++++++++++++++++++++
 docs/_docs/images/svg/refresh_bnf.svg           | 188 ++++++++++++++++++++++++
 docs/_docs/monitoring-metrics/system-views.adoc |  74 ++++++++--
 docs/_docs/sql-reference/ddl.adoc               |  83 +++++++++++
 docs/_docs/tools/control-script.adoc            |  51 +++++++
 9 files changed, 1112 insertions(+), 12 deletions(-)

diff --git a/docs/_data/toc.yaml b/docs/_data/toc.yaml
index e57c9fb..ac3afce 100644
--- a/docs/_data/toc.yaml
+++ b/docs/_data/toc.yaml
@@ -217,6 +217,8 @@
           url: SQL/ODBC/error-codes
     - title: Multiversion Concurrency Control
       url: transactions/mvcc
+    - title: SQL Statistics
+      url: SQL/sql-statistics
 - title: SQL Reference
   url: sql-reference/sql-reference-overview
   items:
diff --git a/docs/_docs/SQL/sql-statistics.adoc b/docs/_docs/SQL/sql-statistics.adoc
new file mode 100644
index 0000000..e9b5d83
--- /dev/null
+++ b/docs/_docs/SQL/sql-statistics.adoc
@@ -0,0 +1,182 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+= SQL Statistics
+
+== Overview
+
+Apache Ignite can calculate statistics by request and use it to build an optimal SQL query plan. This enables you to significantly speed up the SQL query execution.
+
+Without statistics, SQL query execution planner tries to guess about the query conditions selectivity using only general heuristics. To get better plans, make sure that statistics usage is link:tools/control-script#working-with-cluster-properties[enabled,window=_blank] and link:sql-reference/ddl#analyze[configure statistics collection,window=_blank] for tables participated in the query. See the link:SQL/sql-statistics#obtaining-a-better-execution-plan-using-statistics[example] for more details.
+
+Statistics are checked and updated each time after one of the following actions:
+
+* Node start
+* Topology change
+* Configuration change
+
+A node checks partitions and collects statistics for each of them, which can be used in SQL query optimization.
+
+== Configuring Statistics
+
+By default, statistics functionality is enabled.
+
+Statistics are stored locally, while statistics configuration parameters are stored cluster-wide.
+
+To enable or disable statistics in cluster use, execute the following command, specifying  `ON`, `OFF`,  or `NO_UPDATE` values:
+
+[tabs]
+--
+tab:Unix[]
+[source,shell]
+----
+control.sh --property set --name 'statistics.usage.state' --val 'ON'
+----
+tab:Windows[]
+[source,shell]
+----
+control.bat  --property set --name 'statistics.usage.state' --val 'ON'
+----
+--
+
+To see the statistics usage state, execute the command below:
+
+[tabs]
+--
+tab:Unix[]
+[source,shell]
+----
+control.sh --property get --name 'statistics.usage.state'
+----
+tab:Windows[]
+[source,shell]
+----
+control.bat --property get --name 'statistics.usage.state'
+----
+--
+
+For more details on configuring SQL statistics, see the link:monitoring-metrics/system-views#statistics_configuration[System Views,window=_blank] and link:sql-reference/ddl#analyze[Data Definition Language,window=_blank] pages.
+
+== Statistics Overriding
+
+Gathered values can be overridden by specifying additional parameters in the link:sql-reference/ddl#analyze[ANALYZE,window=_blank] command. The specified values override gathered one on each node in link:monitoring-metrics/system-views#statistics_local_data[STATISTICS_LOCAL_DATA,window=_blank] (this data is used by SQL query optimizer), but not in link:monitoring-metrics/system-views#statistics_partition_data[STATISTICS_PARTITION_DATA,window=_blank] (keeps real statistics info by partiti [...]
+
+Each ANALYZE command overrides all such values for its targets. For example, if there is an already overridden TOTAL value and a need to override DISTINCT value, one should use both parameters in one ANALYZE command. To set different values for different columns, use several ANALYZE commands as follows:
+
+[source, sql]
+----
+ANALYZE MY_TABLE(COL_A) WITH 'DISTINCT=5,NULLS=6';
+ANALYZE MY_TABLE(COL_B) WITH 'DISTINCT=500,NULLS=1000,TOTAL=10000';
+----
+
+== Statistics Obsolescence
+
+Each partition has a specialized counter to track the total number of modified (inserted, removed, or updated) rows. If the total number of modified rows is greater than `MAX_CHANGED_PARTITION_ROWS_PERCENT`, a partition is analyzed again. After that, a node aggregates statistics once again to get new statistics.
+
+To adjust the MAX_CHANGED_PARTITION_ROWS_PERCENT parameter, run the `ANALYZE` command with a desired parameter value once again.
+
+By default, the `DEFAULT_OBSOLESCENCE_MAX_PERCENT = 15` parameter is used.
+
+These parameters are applied for all specified targets.
+
+NOTE: As statistics are aggregated through the full scan of each partition, we recommend to disable statistics obsolescence functionality when working with a small number of changing rows. This is particularly true in the case of working with large amounts of data, when a full scan may lead to a performance drop.
+
+To save CPU resources on obsolescence tracking, use the `NO_UPDATE` state:
+
+[tabs]
+--
+tab:Unix[]
+[source,shell]
+----
+control.sh --property set --name 'statistics.usage.state' --val 'NO_UPDATE'
+----
+tab:Windows[]
+[source,shell]
+----
+control.bat --property set --name 'statistics.usage.state' --val 'NO_UPDATE'
+----
+--
+
+== Obtaining a Better Execution Plan Using Statistics
+
+The steps below show an example of obtaining an optimized execution plan for basic query.
+
+. Create a table and insert data into it:
++
+[source, sql]
+----
+CREATE TABLE statistics_test(col1 int PRIMARY KEY, col2 varchar, col3 date);
+
+INSERT INTO statistics_test(col1, col2, col3) VALUES(1, 'val1', '2019-01-01');
+INSERT INTO statistics_test(col1, col2, col3) VALUES(2, 'val2', '2019-03-01');
+INSERT INTO statistics_test(col1, col2, col3) VALUES(3, 'val3', '2019-06-01');
+INSERT INTO statistics_test(col1, col2, col3) VALUES(4, 'val4', '2019-09-01');
+INSERT INTO statistics_test(col1, col2, col3) VALUES(5, 'val5', '2019-12-01');
+INSERT INTO statistics_test(col1, col2, col3) VALUES(6, 'val6', '2020-02-01');
+INSERT INTO statistics_test(col1, col2, col3) VALUES(7, 'val7', '2020-05-01');
+INSERT INTO statistics_test(col1, col2, col3) VALUES(8, 'val8', '2020-08-01');
+INSERT INTO statistics_test(col1, col2, col3) VALUES(9, 'val9', '2020-11-01');
+----
++
+. Create indexes for each column:
++
+[source, sql]
+----
+CREATE INDEX st_col1 ON statistics_test(col1);
+CREATE INDEX st_col2 ON statistics_test(col2);
+CREATE INDEX st_col3 ON statistics_test(col3);
+----
++
+. Get execution plan for basic query:
++
+Note that the `col2` value is less than the max value in the table, while the `col3` value is higher than the maximum one. So it is highly probable that the second condition returns no result, which makes its selectivity higher. Therefore the database should use `st_col3` index.
++
+[source, sql]
+----
+EXPLAIN SELECT * FROM statistics_test WHERE col2 > 'val2' AND col3 > '2020-12-01'
+
+SELECT
+"__Z0"."COL1" AS "__C0_0",
+"__Z0"."COL2" AS "__C0_1",
+"__Z0"."COL3" AS "__C0_2"
+FROM "PUBLIC"."STATISTICS_TEST" "__Z0"
+/* PUBLIC.ST_COL2: COL2 > 'val2' */
+WHERE ("__Z0"."COL2" > 'val2')
+AND ("__Z0"."COL3" > DATE '2020-12-01')
+----
++
+Note that without collected statistics the database does not have enough information to choose the right index (as both indexes have the same selectivity from the planner's point of view). This issue is fixed below.
++
+. Collect statistics for `statistics_test table`:
++
+[source, sql]
+----
+ANALYZE statistics_test;
+----
++
+. Get execution plan again and make sure that `st_col3 index` is chosen:
++
+[source, sql]
+----
+EXPLAIN SELECT * FROM statistics_test WHERE col2 > 'val2' AND col3 > '2020-12-01'
+
+SELECT
+"__Z0"."COL1" AS "__C0_0",
+"__Z0"."COL2" AS "__C0_1",
+"__Z0"."COL3" AS "__C0_2"
+FROM "PUBLIC"."STATISTICS_TEST" "__Z0"
+/* PUBLIC.ST_COL3: COL3 > DATE '2020-12-01' */
+WHERE ("__Z0"."COL2" > 'val2')
+AND ("__Z0"."COL3" > DATE '2020-12-01')
+----
diff --git a/docs/_docs/images/svg/analyze_bnf1.svg b/docs/_docs/images/svg/analyze_bnf1.svg
new file mode 100644
index 0000000..83d2006
--- /dev/null
+++ b/docs/_docs/images/svg/analyze_bnf1.svg
@@ -0,0 +1,188 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<svg class="railroad-diagram" width="689.5" height="131" viewBox="0 0 689.5 131" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <g transform="translate(.5 .5)">
+        <g>
+            <path d="M20 30v20m10 -20v20m-10 -10h20"></path>
+        </g>
+        <path d="M40 40h10"></path>
+        <g class="terminal ">
+            <path d="M50 40h0"></path>
+            <path d="M129.5 40h0"></path>
+            <rect x="50" y="29" width="79.5" height="22" rx="10" ry="10"></rect>
+            <text x="89.75" y="44">ANALYZE</text>
+        </g>
+        <path d="M129.5 40h10"></path>
+        <path d="M139.5 40h10"></path>
+        <g>
+            <path d="M149.5 40h0"></path>
+            <path d="M639.5 40h0"></path>
+            <path d="M149.5 40h10"></path>
+            <g>
+                <path d="M159.5 40h0"></path>
+                <path d="M629.5 40h0"></path>
+                <g>
+                    <path d="M159.5 40h0"></path>
+                    <path d="M319 40h0"></path>
+                    <path d="M159.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
+                    <g>
+                        <path d="M179.5 20h119.5"></path>
+                    </g>
+                    <path d="M299 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
+                    <path d="M159.5 40h20"></path>
+                    <g>
+                        <path d="M179.5 40h0"></path>
+                        <path d="M299 40h0"></path>
+                        <g class="terminal ">
+                            <path d="M179.5 40h0"></path>
+                            <path d="M250.5 40h0"></path>
+                            <rect x="179.5" y="29" width="71" height="22" rx="10" ry="10"></rect>
+                            <text x="215" y="44">SCHEMA</text>
+                        </g>
+                        <path d="M250.5 40h10"></path>
+                        <path d="M260.5 40h10"></path>
+                        <g class="terminal ">
+                            <path d="M270.5 40h0"></path>
+                            <path d="M299 40h0"></path>
+                            <rect x="270.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
+                            <text x="284.75" y="44">.</text>
+                        </g>
+                    </g>
+                    <path d="M299 40h20"></path>
+                </g>
+                <path d="M319 40h10"></path>
+                <g class="terminal ">
+                    <path d="M329 40h0"></path>
+                    <path d="M391.5 40h0"></path>
+                    <rect x="329" y="29" width="62.5" height="22" rx="10" ry="10"></rect>
+                    <text x="360.25" y="44">TABLE</text>
+                </g>
+                <path d="M391.5 40h10"></path>
+                <g>
+                    <path d="M401.5 40h0"></path>
+                    <path d="M629.5 40h0"></path>
+                    <path d="M401.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
+                    <g>
+                        <path d="M421.5 20h188"></path>
+                    </g>
+                    <path d="M609.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
+                    <path d="M401.5 40h20"></path>
+                    <g>
+                        <path d="M421.5 40h0"></path>
+                        <path d="M609.5 40h0"></path>
+                        <g class="terminal ">
+                            <path d="M421.5 40h0"></path>
+                            <path d="M450 40h0"></path>
+                            <rect x="421.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
+                            <text x="435.75" y="44">(</text>
+                        </g>
+                        <path d="M450 40h10"></path>
+                        <path d="M460 40h10"></path>
+                        <g>
+                            <path d="M470 40h0"></path>
+                            <path d="M561 40h0"></path>
+                            <path d="M470 40h10"></path>
+                            <g class="terminal ">
+                                <path d="M480 40h0"></path>
+                                <path d="M551 40h0"></path>
+                                <rect x="480" y="29" width="71" height="22" rx="10" ry="10"></rect>
+                                <text x="515.5" y="44">COLUMN</text>
+                            </g>
+                            <path d="M551 40h10"></path>
+                            <path d="M480 40a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path>
+                            <g class="terminal ">
+                                <path d="M480 70h21.25"></path>
+                                <path d="M529.75 70h21.25"></path>
+                                <rect x="501.25" y="59" width="28.5" height="22" rx="10" ry="10"></rect>
+                                <text x="515.5" y="74">,</text>
+                            </g>
+                            <path d="M551 70a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path>
+                        </g>
+                        <path d="M561 40h10"></path>
+                        <path d="M571 40h10"></path>
+                        <g class="terminal ">
+                            <path d="M581 40h0"></path>
+                            <path d="M609.5 40h0"></path>
+                            <rect x="581" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
+                            <text x="595.25" y="44">)</text>
+                        </g>
+                    </g>
+                    <path d="M609.5 40h20"></path>
+                </g>
+            </g>
+            <path d="M629.5 40h10"></path>
+            <path d="M159.5 40a10 10 0 0 0 -10 10v40a10 10 0 0 0 10 10"></path>
+            <g class="terminal ">
+                <path d="M159.5 100h220.75"></path>
+                <path d="M408.75 100h220.75"></path>
+                <rect x="380.25" y="89" width="28.5" height="22" rx="10" ry="10"></rect>
+                <text x="394.5" y="104">,</text>
+            </g>
+            <path d="M629.5 100a10 10 0 0 0 10 -10v-40a10 10 0 0 0 -10 -10"></path>
+        </g>
+        <path d="M639.5 40h10"></path>
+        <path stroke-dasharray="5,5" d="M655 40 l30 0" />
+    </g>
+    <style>
+        svg {
+        background-color: hsl(0,0%,100%);
+        }
+        path {
+        stroke-width: 2;
+        stroke: black;
+        fill: rgba(0,0,0,0);
+        }
+        text {
+        font: bold 14px monospace;
+        text-anchor: middle;
+        white-space: pre;
+        }
+        text.diagram-text {
+        font-size: 12px;
+        }
+        text.diagram-arrow {
+        font-size: 16px;
+        }
+        text.label {
+        text-anchor: start;
+        }
+        text.comment {
+        font: italic 12px monospace;
+        }
+        g.non-terminal text {
+        /&#42;font-style: italic;&#42;/
+        }
+        rect {
+        stroke-width: 2;
+        stroke: black;
+        fill: hsl(0,0%,100%);
+        }
+        rect.group-box {
+        stroke: gray;
+        stroke-dasharray: 10 5;
+        fill: none;
+        }
+        path.diagram-text {
+        stroke-width: 2;
+        stroke: black;
+        fill: white;
+        cursor: help;
+        }
+        g.diagram-text:hover path.diagram-text {
+        fill: #eee;
+        }</style>
+</svg>
diff --git a/docs/_docs/images/svg/analyze_bnf2.svg b/docs/_docs/images/svg/analyze_bnf2.svg
new file mode 100644
index 0000000..a9c0313
--- /dev/null
+++ b/docs/_docs/images/svg/analyze_bnf2.svg
@@ -0,0 +1,168 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<svg class="railroad-diagram" width="573" height="101" viewBox="0 0 573 101" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <g transform="translate(.5 .5)">
+        <g fill="none" stroke="black" stroke-width="2">
+            <path stroke-dasharray="5,5" d="M10 40 l30 0" />
+        </g>
+        <g>
+            <path d="M40 40h0"></path>
+            <path d="M464.5 40h0"></path>
+            <path d="M40 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
+            <g>
+                <path d="M60 20h384.5"></path>
+            </g>
+            <path d="M444.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
+            <path d="M40 40h20"></path>
+            <g>
+                <path d="M60 40h0"></path>
+                <path d="M444.5 40h0"></path>
+                <g class="terminal ">
+                    <path d="M60 40h0"></path>
+                    <path d="M114 40h0"></path>
+                    <rect x="60" y="29" width="54" height="22" rx="10" ry="10"></rect>
+                    <text x="87" y="44">WITH</text>
+                </g>
+                <path d="M114 40h10"></path>
+                <path d="M124 40h10"></path>
+                <g class="terminal ">
+                    <path d="M134 40h0"></path>
+                    <path d="M162.5 40h0"></path>
+                    <rect x="134" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
+                    <text x="148.25" y="44">'</text>
+                </g>
+                <path d="M162.5 40h10"></path>
+                <path d="M172.5 40h10"></path>
+                <g>
+                    <path d="M182.5 40h0"></path>
+                    <path d="M396 40h0"></path>
+                    <path d="M182.5 40h10"></path>
+                    <g>
+                        <path d="M192.5 40h0"></path>
+                        <path d="M386 40h0"></path>
+                        <g class="terminal ">
+                            <path d="M192.5 40h0"></path>
+                            <path d="M255 40h0"></path>
+                            <rect x="192.5" y="29" width="62.5" height="22" rx="10" ry="10"></rect>
+                            <text x="223.75" y="44">PARAM</text>
+                        </g>
+                        <path d="M255 40h10"></path>
+                        <path d="M265 40h10"></path>
+                        <g class="terminal ">
+                            <path d="M275 40h0"></path>
+                            <path d="M303.5 40h0"></path>
+                            <rect x="275" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
+                            <text x="289.25" y="44">=</text>
+                        </g>
+                        <path d="M303.5 40h10"></path>
+                        <path d="M313.5 40h10"></path>
+                        <g class="terminal ">
+                            <path d="M323.5 40h0"></path>
+                            <path d="M386 40h0"></path>
+                            <rect x="323.5" y="29" width="62.5" height="22" rx="10" ry="10"></rect>
+                            <text x="354.75" y="44">VALUE</text>
+                        </g>
+                    </g>
+                    <path d="M386 40h10"></path>
+                    <path d="M192.5 40a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path>
+                    <g class="terminal ">
+                        <path d="M192.5 70h82.5"></path>
+                        <path d="M303.5 70h82.5"></path>
+                        <rect x="275" y="59" width="28.5" height="22" rx="10" ry="10"></rect>
+                        <text x="289.25" y="74">,</text>
+                    </g>
+                    <path d="M386 70a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path>
+                </g>
+                <path d="M396 40h10"></path>
+                <path d="M406 40h10"></path>
+                <g class="terminal ">
+                    <path d="M416 40h0"></path>
+                    <path d="M444.5 40h0"></path>
+                    <rect x="416" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
+                    <text x="430.25" y="44">'</text>
+                </g>
+            </g>
+            <path d="M444.5 40h20"></path>
+        </g>
+        <g>
+            <path d="M464.5 40h0"></path>
+            <path d="M533 40h0"></path>
+            <path d="M464.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
+            <g>
+                <path d="M484.5 20h28.5"></path>
+            </g>
+            <path d="M513 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
+            <path d="M464.5 40h20"></path>
+            <g class="terminal ">
+                <path d="M484.5 40h0"></path>
+                <path d="M513 40h0"></path>
+                <rect x="484.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
+                <text x="498.75" y="44">;</text>
+            </g>
+            <path d="M513 40h20"></path>
+        </g>
+        <path d="M 533 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path>
+    </g>
+    <style>
+        svg {
+        background-color: hsl(0,0%,100%);
+        }
+        path {
+        stroke-width: 2;
+        stroke: black;
+        fill: rgba(0,0,0,0);
+        }
+        text {
+        font: bold 14px monospace;
+        text-anchor: middle;
+        white-space: pre;
+        }
+        text.diagram-text {
+        font-size: 12px;
+        }
+        text.diagram-arrow {
+        font-size: 16px;
+        }
+        text.label {
+        text-anchor: start;
+        }
+        text.comment {
+        font: italic 12px monospace;
+        }
+        g.non-terminal text {
+        /&#42;font-style: italic;&#42;/
+        }
+        rect {
+        stroke-width: 2;
+        stroke: black;
+        fill: hsl(0,0%,100%);
+        }
+        rect.group-box {
+        stroke: gray;
+        stroke-dasharray: 10 5;
+        fill: none;
+        }
+        path.diagram-text {
+        stroke-width: 2;
+        stroke: black;
+        fill: white;
+        cursor: help;
+        }
+        g.diagram-text:hover path.diagram-text {
+        fill: #eee;
+        }</style>
+</svg>
diff --git a/docs/_docs/images/svg/drop_bnf.svg b/docs/_docs/images/svg/drop_bnf.svg
new file mode 100644
index 0000000..c57c67d
--- /dev/null
+++ b/docs/_docs/images/svg/drop_bnf.svg
@@ -0,0 +1,188 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<svg class="railroad-diagram" width="757.5" height="131" viewBox="0 0 757.5 131" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <g transform="translate(.5 .5)">
+        <g>
+            <path d="M20 30v20m10 -20v20m-10 -10h20"></path>
+        </g>
+        <path d="M40 40h10"></path>
+        <g class="terminal ">
+            <path d="M50 40h0"></path>
+            <path d="M197.5 40h0"></path>
+            <rect x="50" y="29" width="147.5" height="22" rx="10" ry="10"></rect>
+            <text x="123.75" y="44">DROP STATISTICS</text>
+        </g>
+        <path d="M197.5 40h10"></path>
+        <path d="M207.5 40h10"></path>
+        <g>
+            <path d="M217.5 40h0"></path>
+            <path d="M707.5 40h0"></path>
+            <path d="M217.5 40h10"></path>
+            <g>
+                <path d="M227.5 40h0"></path>
+                <path d="M697.5 40h0"></path>
+                <g>
+                    <path d="M227.5 40h0"></path>
+                    <path d="M387 40h0"></path>
+                    <path d="M227.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
+                    <g>
+                        <path d="M247.5 20h119.5"></path>
+                    </g>
+                    <path d="M367 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
+                    <path d="M227.5 40h20"></path>
+                    <g>
+                        <path d="M247.5 40h0"></path>
+                        <path d="M367 40h0"></path>
+                        <g class="terminal ">
+                            <path d="M247.5 40h0"></path>
+                            <path d="M318.5 40h0"></path>
+                            <rect x="247.5" y="29" width="71" height="22" rx="10" ry="10"></rect>
+                            <text x="283" y="44">SCHEMA</text>
+                        </g>
+                        <path d="M318.5 40h10"></path>
+                        <path d="M328.5 40h10"></path>
+                        <g class="terminal ">
+                            <path d="M338.5 40h0"></path>
+                            <path d="M367 40h0"></path>
+                            <rect x="338.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
+                            <text x="352.75" y="44">.</text>
+                        </g>
+                    </g>
+                    <path d="M367 40h20"></path>
+                </g>
+                <path d="M387 40h10"></path>
+                <g class="terminal ">
+                    <path d="M397 40h0"></path>
+                    <path d="M459.5 40h0"></path>
+                    <rect x="397" y="29" width="62.5" height="22" rx="10" ry="10"></rect>
+                    <text x="428.25" y="44">TABLE</text>
+                </g>
+                <path d="M459.5 40h10"></path>
+                <g>
+                    <path d="M469.5 40h0"></path>
+                    <path d="M697.5 40h0"></path>
+                    <path d="M469.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
+                    <g>
+                        <path d="M489.5 20h188"></path>
+                    </g>
+                    <path d="M677.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
+                    <path d="M469.5 40h20"></path>
+                    <g>
+                        <path d="M489.5 40h0"></path>
+                        <path d="M677.5 40h0"></path>
+                        <g class="terminal ">
+                            <path d="M489.5 40h0"></path>
+                            <path d="M518 40h0"></path>
+                            <rect x="489.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
+                            <text x="503.75" y="44">(</text>
+                        </g>
+                        <path d="M518 40h10"></path>
+                        <path d="M528 40h10"></path>
+                        <g>
+                            <path d="M538 40h0"></path>
+                            <path d="M629 40h0"></path>
+                            <path d="M538 40h10"></path>
+                            <g class="terminal ">
+                                <path d="M548 40h0"></path>
+                                <path d="M619 40h0"></path>
+                                <rect x="548" y="29" width="71" height="22" rx="10" ry="10"></rect>
+                                <text x="583.5" y="44">COLUMN</text>
+                            </g>
+                            <path d="M619 40h10"></path>
+                            <path d="M548 40a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path>
+                            <g class="terminal ">
+                                <path d="M548 70h21.25"></path>
+                                <path d="M597.75 70h21.25"></path>
+                                <rect x="569.25" y="59" width="28.5" height="22" rx="10" ry="10"></rect>
+                                <text x="583.5" y="74">,</text>
+                            </g>
+                            <path d="M619 70a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path>
+                        </g>
+                        <path d="M629 40h10"></path>
+                        <path d="M639 40h10"></path>
+                        <g class="terminal ">
+                            <path d="M649 40h0"></path>
+                            <path d="M677.5 40h0"></path>
+                            <rect x="649" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
+                            <text x="663.25" y="44">)</text>
+                        </g>
+                    </g>
+                    <path d="M677.5 40h20"></path>
+                </g>
+            </g>
+            <path d="M697.5 40h10"></path>
+            <path d="M227.5 40a10 10 0 0 0 -10 10v40a10 10 0 0 0 10 10"></path>
+            <g class="terminal ">
+                <path d="M227.5 100h220.75"></path>
+                <path d="M476.75 100h220.75"></path>
+                <rect x="448.25" y="89" width="28.5" height="22" rx="10" ry="10"></rect>
+                <text x="462.5" y="104">,</text>
+            </g>
+            <path d="M697.5 100a10 10 0 0 0 10 -10v-40a10 10 0 0 0 -10 -10"></path>
+        </g>
+        <path d="M707.5 40h10"></path>
+        <path d="M 717.5 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path>
+    </g>
+    <style>
+        svg {
+        background-color: hsl(0,0%,100%);
+        }
+        path {
+        stroke-width: 2;
+        stroke: black;
+        fill: rgba(0,0,0,0);
+        }
+        text {
+        font: bold 14px monospace;
+        text-anchor: middle;
+        white-space: pre;
+        }
+        text.diagram-text {
+        font-size: 12px;
+        }
+        text.diagram-arrow {
+        font-size: 16px;
+        }
+        text.label {
+        text-anchor: start;
+        }
+        text.comment {
+        font: italic 12px monospace;
+        }
+        g.non-terminal text {
+        /&#42;font-style: italic;&#42;/
+        }
+        rect {
+        stroke-width: 2;
+        stroke: black;
+        fill: hsl(0,0%,100%);
+        }
+        rect.group-box {
+        stroke: gray;
+        stroke-dasharray: 10 5;
+        fill: none;
+        }
+        path.diagram-text {
+        stroke-width: 2;
+        stroke: black;
+        fill: white;
+        cursor: help;
+        }
+        g.diagram-text:hover path.diagram-text {
+        fill: #eee;
+        }</style>
+</svg>
diff --git a/docs/_docs/images/svg/refresh_bnf.svg b/docs/_docs/images/svg/refresh_bnf.svg
new file mode 100644
index 0000000..0ae64a1
--- /dev/null
+++ b/docs/_docs/images/svg/refresh_bnf.svg
@@ -0,0 +1,188 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<svg class="railroad-diagram" width="689.5" height="131" viewBox="0 0 689.5 131" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <g transform="translate(.5 .5)">
+        <g>
+            <path d="M20 30v20m10 -20v20m-10 -10h20"></path>
+        </g>
+        <path d="M40 40h10"></path>
+        <g class="terminal ">
+            <path d="M50 40h0"></path>
+            <path d="M129.5 40h0"></path>
+            <rect x="50" y="29" width="79.5" height="22" rx="10" ry="10"></rect>
+            <text x="89.75" y="44">REFRESH</text>
+        </g>
+        <path d="M129.5 40h10"></path>
+        <path d="M139.5 40h10"></path>
+        <g>
+            <path d="M149.5 40h0"></path>
+            <path d="M639.5 40h0"></path>
+            <path d="M149.5 40h10"></path>
+            <g>
+                <path d="M159.5 40h0"></path>
+                <path d="M629.5 40h0"></path>
+                <g>
+                    <path d="M159.5 40h0"></path>
+                    <path d="M319 40h0"></path>
+                    <path d="M159.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
+                    <g>
+                        <path d="M179.5 20h119.5"></path>
+                    </g>
+                    <path d="M299 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
+                    <path d="M159.5 40h20"></path>
+                    <g>
+                        <path d="M179.5 40h0"></path>
+                        <path d="M299 40h0"></path>
+                        <g class="terminal ">
+                            <path d="M179.5 40h0"></path>
+                            <path d="M250.5 40h0"></path>
+                            <rect x="179.5" y="29" width="71" height="22" rx="10" ry="10"></rect>
+                            <text x="215" y="44">SCHEMA</text>
+                        </g>
+                        <path d="M250.5 40h10"></path>
+                        <path d="M260.5 40h10"></path>
+                        <g class="terminal ">
+                            <path d="M270.5 40h0"></path>
+                            <path d="M299 40h0"></path>
+                            <rect x="270.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
+                            <text x="284.75" y="44">.</text>
+                        </g>
+                    </g>
+                    <path d="M299 40h20"></path>
+                </g>
+                <path d="M319 40h10"></path>
+                <g class="terminal ">
+                    <path d="M329 40h0"></path>
+                    <path d="M391.5 40h0"></path>
+                    <rect x="329" y="29" width="62.5" height="22" rx="10" ry="10"></rect>
+                    <text x="360.25" y="44">TABLE</text>
+                </g>
+                <path d="M391.5 40h10"></path>
+                <g>
+                    <path d="M401.5 40h0"></path>
+                    <path d="M629.5 40h0"></path>
+                    <path d="M401.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
+                    <g>
+                        <path d="M421.5 20h188"></path>
+                    </g>
+                    <path d="M609.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
+                    <path d="M401.5 40h20"></path>
+                    <g>
+                        <path d="M421.5 40h0"></path>
+                        <path d="M609.5 40h0"></path>
+                        <g class="terminal ">
+                            <path d="M421.5 40h0"></path>
+                            <path d="M450 40h0"></path>
+                            <rect x="421.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
+                            <text x="435.75" y="44">(</text>
+                        </g>
+                        <path d="M450 40h10"></path>
+                        <path d="M460 40h10"></path>
+                        <g>
+                            <path d="M470 40h0"></path>
+                            <path d="M561 40h0"></path>
+                            <path d="M470 40h10"></path>
+                            <g class="terminal ">
+                                <path d="M480 40h0"></path>
+                                <path d="M551 40h0"></path>
+                                <rect x="480" y="29" width="71" height="22" rx="10" ry="10"></rect>
+                                <text x="515.5" y="44">COLUMN</text>
+                            </g>
+                            <path d="M551 40h10"></path>
+                            <path d="M480 40a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path>
+                            <g class="terminal ">
+                                <path d="M480 70h21.25"></path>
+                                <path d="M529.75 70h21.25"></path>
+                                <rect x="501.25" y="59" width="28.5" height="22" rx="10" ry="10"></rect>
+                                <text x="515.5" y="74">,</text>
+                            </g>
+                            <path d="M551 70a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path>
+                        </g>
+                        <path d="M561 40h10"></path>
+                        <path d="M571 40h10"></path>
+                        <g class="terminal ">
+                            <path d="M581 40h0"></path>
+                            <path d="M609.5 40h0"></path>
+                            <rect x="581" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
+                            <text x="595.25" y="44">)</text>
+                        </g>
+                    </g>
+                    <path d="M609.5 40h20"></path>
+                </g>
+            </g>
+            <path d="M629.5 40h10"></path>
+            <path d="M159.5 40a10 10 0 0 0 -10 10v40a10 10 0 0 0 10 10"></path>
+            <g class="terminal ">
+                <path d="M159.5 100h220.75"></path>
+                <path d="M408.75 100h220.75"></path>
+                <rect x="380.25" y="89" width="28.5" height="22" rx="10" ry="10"></rect>
+                <text x="394.5" y="104">,</text>
+            </g>
+            <path d="M629.5 100a10 10 0 0 0 10 -10v-40a10 10 0 0 0 -10 -10"></path>
+        </g>
+        <path d="M639.5 40h10"></path>
+        <path d="M 649.5 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path>
+    </g>
+    <style>
+        svg {
+        background-color: hsl(0,0%,100%);
+        }
+        path {
+        stroke-width: 2;
+        stroke: black;
+        fill: rgba(0,0,0,0);
+        }
+        text {
+        font: bold 14px monospace;
+        text-anchor: middle;
+        white-space: pre;
+        }
+        text.diagram-text {
+        font-size: 12px;
+        }
+        text.diagram-arrow {
+        font-size: 16px;
+        }
+        text.label {
+        text-anchor: start;
+        }
+        text.comment {
+        font: italic 12px monospace;
+        }
+        g.non-terminal text {
+        /&#42;font-style: italic;&#42;/
+        }
+        rect {
+        stroke-width: 2;
+        stroke: black;
+        fill: hsl(0,0%,100%);
+        }
+        rect.group-box {
+        stroke: gray;
+        stroke-dasharray: 10 5;
+        fill: none;
+        }
+        path.diagram-text {
+        stroke-width: 2;
+        stroke: black;
+        fill: white;
+        cursor: help;
+        }
+        g.diagram-text:hover path.diagram-text {
+        fill: #eee;
+        }</style>
+</svg>
diff --git a/docs/_docs/monitoring-metrics/system-views.adoc b/docs/_docs/monitoring-metrics/system-views.adoc
index ddc5593..c642aad 100644
--- a/docs/_docs/monitoring-metrics/system-views.adoc
+++ b/docs/_docs/monitoring-metrics/system-views.adoc
@@ -457,8 +457,6 @@ This view exposes information about currently running continuous queries.
 |TOPIC | string |  Query topic name
 |===
 
-
-
 == SQL_QUERIES
 
 This view exposes information about currently running SQL queries.
@@ -490,7 +488,6 @@ This view exposes information about currently running SQL queries.
 |LAST_START_TIME | date |    Last execution date
 |===
 
-
 == SCHEMAS
 
 This view exposes information about SQL schemas.
@@ -569,11 +566,8 @@ The NODE_METRICS view provides various metrics about the state of nodes, resourc
 
 |===
 
-
-
 == TABLES
 
-
 The TABLES view contains information about the SQL tables.
 
 [{table_opts}]
@@ -593,7 +587,6 @@ The TABLES view contains information about the SQL tables.
 
 |===
 
-
 == TABLE_COLUMNS
 
 This view exposes information about SQL table columns.
@@ -614,8 +607,6 @@ This view exposes information about SQL table columns.
 |TYPE | string |  Column type
 |===
 
-
-
 == VIEWS
 
 This view exposes information about SQL views.
@@ -628,7 +619,6 @@ This view exposes information about SQL views.
 |DESCRIPTION | string |  Description
 |===
 
-
 == VIEW_COLUMNS
 
 This view exposes information about SQL views columns.
@@ -665,7 +655,6 @@ The INDEXES view contains information about SQL indexes.
 |IS_UNIQUE | boolean | True if unique index
 |===
 
-
 == PAGE_LISTS
 
 The page list is a data structure used to store a list of partially free data pages (free lists) and fully free allocated
@@ -679,7 +668,6 @@ In this case, the `DATA_REGION_PAGE_LISTS` system view needs to used. These view
 of each page list that is useful to understand how much data can be inserted into a cache without allocating new pages
 and also helps to detect skews in page lists utilization.
 
-
 === CACHE_GROUP_PAGE_LISTS
 
 [{table_opts}]
@@ -899,3 +887,65 @@ Note, lock will be shown on the non parent node only after initial usage on that
 |GROUP_ID | int | Cache group id to store data structure
 |REMOVED | boolean | `True` if removed
 |===
+
+== STATISTICS_CONFIGURATION
+
+The STATISTICS_CONFIGURATION view contains information about link:SQL/sql-statistics[SQL statistics,window=_blank] configuration.
+
+[cols="2,1,4",opts="header,stretch"]
+|===
+|Column|Data Type|Description
+|SCHEMA |VARCHAR |Schema name.
+|TYPE |VARCHAR |Object type.
+|NAME |VARCHAR |Object name.
+|COLUMN |VARCHAR |Column name.
+|MAX_PARTITION_OBSOLESCENCE_PERCENT |TINYINT |Maximum percentage of obsolescent rows in statistics. See the link:SQL/sql-statistics#statistics-obsolescence[SQL Statistics,window=_blank] page for more details.
+|MANUAL_NULLS |BIGINT |If not null - overrided number of null values.
+|MANUAL_DISTINCT |BIGINT |If not null - overrided number of distinct values.
+|MANUAL_TOTAL |BIGINT |If not null - overrided total number of values.
+|MANUAL_SIZE |INT |If not null - overrided average size of non null values in column.
+|VERSION |BIGINT |Configuration version.
+|===
+
+
+== STATISTICS_LOCAL_DATA
+
+The STATISTICS_LOCAL_DATA view contains link:SQL/sql-statistics[SQL statistics,window=_blank] for locally managed (or stored) data. This view is node-specific, so each node has an instance of the view that contains information about its local data statistics.
+
+[cols="2,1,4",opts="header,stretch"]
+|===
+|Column|Data Type|Description
+|SCHEMA |VARCHAR |Schema name.
+|TYPE |VARCHAR |Object type.
+|NAME |VARCHAR |Object name.
+|COLUMN |VARCHAR |Column name.
+|ROWS_COUNT |BIGINT |Count of column rows.
+|DISTINCT |BIGINT |Number of unique non-null values.
+|NULLS |BIGINT |Number of null values.
+|TOTAL |BIGINT |Total number of values in column.
+|SIZE |INTEGER |Average value size in bytes.
+|VERSION |BIGINT |Statistics version.
+|LAST_UPDATE_TIME |VARCHAR |Maximum time of all partition statistics which was used to generate local one.
+|===
+
+== STATISTICS_PARTITION_DATA
+
+The STATISTICS_PARTITION_DATA view contains information about link:SQL/sql-statistics[SQL statistics,window=_blank] on every partition data stored on a local node.
+
+[cols="2,1,4",opts="header,stretch"]
+|===
+|Column|Data Type|Description
+|SCHEMA |VARCHAR |Schema name.
+|TYPE |VARCHAR |Object type.
+|NAME |VARCHAR |Object name.
+|COLUMN |VARCHAR |Column name.
+|PARTITION |INTEGER |Partition number.
+|ROWS_COUNT |BIGINT |Count of column rows.
+|UPDATE_COUNTER |BIGINT |Partition counter update when statistics are collected.
+|DISTINCT |BIGINT |Number of unique non-null values.
+|NULLS |BIGINT |Number of null values.
+|TOTAL |BIGINT |Total number of values in column.
+|SIZE |INTEGER |Average value size in bytes.
+|VERSION |BIGINT |Statistics version.
+|LAST_UPDATE_TIME |VARCHAR |Maximum time of all partition statistics which was used to generate local one.
+|===
diff --git a/docs/_docs/sql-reference/ddl.adoc b/docs/_docs/sql-reference/ddl.adoc
index e55d757..5e91773 100644
--- a/docs/_docs/sql-reference/ddl.adoc
+++ b/docs/_docs/sql-reference/ddl.adoc
@@ -518,3 +518,86 @@ Examples:
 DROP USER test;
 ----
 
+== ANALYZE
+
+The ANALYZE command collects link:SQL/sql-statistics[statistics,window=_blank].
+
+[source,sql]
+----
+ANALYZE 'schemaName'.'tableName'(column1, column2);
+----
+
+Parameters:
+
+* `schemaName` - a name of the schema to collect statistics for.
+* `tableName` - a name of the table to collect statistics for.
+* `(column1, column2)` - names of the columns to collect statistics for.
+
+image::images/svg/analyze_bnf1.svg[Embedded,opts=inline]
+
+image::images/svg/analyze_bnf2.svg[Embedded,opts=inline]
+
+When the ANALYZE command is used with `with` parameters statement, specified parameters are applied for every target. For example:
+
+[source,sql]
+----
+ANALYZE public.statistics_test, statistics_test2, statistics_test3(col3) WITH 'MAX_CHANGED_PARTITION_ROWS_PERCENT=15,NULLS=0'
+----
+
+Possible parameters:
+
+* MAX_CHANGED_PARTITION_ROWS_PERCENT - Maximum percentage of outdated rows in the table (the default value is 15%). See the link:SQL/sql-statistics#statistics-obsolescence[SQL Statistics,window=_blank] page for more details.
+* NULLS - Number of null values in column.
+* TOTAL - Total number of column values.
+* SIZE - Average size of column values (in bytes).
+* DISTINCT - Number of distinct non-null values in column.
+
+== REFRESH
+
+The command refreshes link:SQL/sql-statistics[statistics,window=_blank].
+
+[source,sql]
+----
+REFRESH 'schemaName'.'tableName'(column1, column2);
+----
+
+Parameters:
+
+* `schemaName` - a name of the schema to refresh statistics for.
+* `tableName` - a name of the table to refresh statistics for.
+* `(column1, column2)` - names of the columns to refresh statistics for.
+
+image::images/svg/refresh_bnf.svg[Embedded,opts=inline]
+
+Example:
+
+[source,sql]
+----
+REFRESH PRODUCTS, SALE(productId, discount)
+----
+
+== DROP STATISTICS
+
+The command drops link:SQL/sql-statistics[statistics,window=_blank].
+
+[source,sql]
+----
+DROP STATISTICS 'schemaName'.'tableName'(column1, column2);
+----
+
+Parameters:
+
+* `schemaName` - a name of the schema to drop statistics for.
+* `tableName` - a name of the table to drop statistics for.
+* `(column1, column2)` - names of the columns to drop statistics for.
+
+image::images/svg/drop_bnf.svg[Embedded,opts=inline]
+
+Example:
+
+[source,sql]
+----
+DROP STATISTICS USERS, ORDERS(customerId, productId)
+----
+
+
diff --git a/docs/_docs/tools/control-script.adoc b/docs/_docs/tools/control-script.adoc
index 527ef0c..be2f9ed 100644
--- a/docs/_docs/tools/control-script.adoc
+++ b/docs/_docs/tools/control-script.adoc
@@ -975,6 +975,57 @@ Parameters:
 | `status`| Get status of collecting performance statistics in the cluster.
 |===
 
+== Working with Cluster Properties
+
+The `control.sh|bat` script provides an ability to work with link:SQL/sql-statistics[SQL statistics,window=_blank] functionality.
+
+To get the full list of available properties, use the `--property list` command. This command returns the list of all available properties to work with:
+
+[tabs]
+--
+tab:Unix[]
+[source,shell]
+----
+control.sh --property list
+----
+tab:Windows[]
+[source,shell]
+----
+control.bat  --property list
+----
+--
+
+You can set property value with `--property set` command. For example, to enable or disable SQL statistics in cluster use, specify `ON`, `OFF`,  or `NO_UPDATE` values:
+
+[tabs]
+--
+tab:Unix[]
+[source,shell]
+----
+control.sh --property set --name 'statistics.usage.state' --val 'ON'
+----
+tab:Windows[]
+[source,shell]
+----
+control.bat  --property set --name 'statistics.usage.state' --val 'ON'
+----
+--
+
+You can also get property value with `--property get` command. For example:
+
+[tabs]
+--
+tab:Unix[]
+[source,shell]
+----
+control.sh --property get --name 'statistics.usage.state'
+----
+tab:Windows[]
+[source,shell]
+----
+control.bat --property get --name 'statistics.usage.state'
+----
+
 == Cache Consistency
 
 === Repair