Skip to content

Commit e1112ee

Browse files
committed
Add Release notes for V5.8
1 parent ccbfdd4 commit e1112ee

File tree

2 files changed

+253
-0
lines changed

2 files changed

+253
-0
lines changed
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# GridDB CE 5.8
2+
3+
## Changes in V5.8
4+
5+
The main changes in GridDB CE version 5.8 are as follows:
6+
7+
- SQL Optimization Enhancements
8+
9+
Supported Join Optimization for the driving table, the inner table of SQL execution. The join plan can be generated with the cost-based method.
10+
11+
- Timeseries-data Functionality Enhancements
12+
13+
Supported moving average calculation for SQL analytic functions. And improved the accuracy of date arithmetic functions.
14+
15+
---
16+
17+
## SQL Optimization Enhancements
18+
19+
It is now possible to switch between cost-based and rule-based methods to select the driving table and the inner table for join operation, and this can be configured using the following:
20+
- Cluster definition file (gs_cluster.json)
21+
- Hint phase
22+
23+
Using the cluster definition file (gs_cluster.json):
24+
25+
* /sql/costBasedJoinDriving:Specifies whether to use the cost-based method for determining the driving table for join during SQL plan generation. If set to false, it uses the rule-based method. The default value is true, which indicates the cost-based method.
26+
27+
28+
Using the hint phase:
29+
30+
* CostBasedJoinDriving():Use the cost-based method for determining the driving table for join.
31+
* NoCostBasedJoinDriving():Use the rule-based method for determining the driving table for join.
32+
33+
## Timeseries-data Functionality Enhancements
34+
35+
### Supported moving average calculation for SQL analytic functions
36+
37+
38+
Added FRAME clause for SQL analytic functions
39+
40+
``` example
41+
function OVER ( [PARTITION BY expression1 ] [ ORDER BY expression2 ] [ FRAME-clause ] )
42+
```
43+
44+
The syntax of FRAME-clause is as bellow:
45+
46+
``` example
47+
ROWS | RANGE <FRAME-start-value> | BETWEEN <FRAME-start-value> AND <FRAME-end-value>
48+
```
49+
50+
The syntax of the start value and the end value of Frame is as bellow:
51+
52+
``` example
53+
UNBOUNDED PRECEDING | UNBOUNDED FOLLOWING | CURRENT ROW | <Frame-boundary1> PRECEDING | <Frame-boundary2> FOLLOWING
54+
```
55+
56+
- CURRENT ROW: Specify the current row to be analyzed
57+
- UNBOUNDED: Specify the head or the tail of the partition
58+
- PRECEDING/FOLLOWING: Specify preceding or following
59+
60+
The syntax of the boundary of Frame is as bellow:
61+
62+
``` example
63+
value1 | ( value2, unit )
64+
```
65+
66+
- The following functions can be specified the FRAME-clause.
67+
68+
AVG、COUNT、MAX、MIN、SUM、TOTAL、STDDEV、VAR
69+
70+
- The following functions can not be specified the FRAME-clause.
71+
72+
ROW_NUMBER、LAG、LEAD
73+
74+
例)
75+
76+
Calculate the moving average for the previous 10 rows.
77+
78+
``` example
79+
SELECT
80+
AVG(value1)
81+
OVER(ORDER BY time)
82+
ROWS BETWEEN 10 PRECEDING AND CURRENT ROW
83+
FROM tbl1;
84+
```
85+
86+
Calculate the moving average for the period up to 10 minutes prior to each row.
87+
88+
``` example
89+
SELECT
90+
AVG(value1)
91+
OVER(ORDER BY time)
92+
RANGE BETWEEN (10, MINUTE) PRECEDING AND CURRENT ROW
93+
FROM tbl1;
94+
```
95+
96+
### Improved the accuracy of date arithmetic functions
97+
98+
Added the following functions for SQL and TQL(query language for NoSQL Interface).
99+
100+
- SQL
101+
``` example
102+
* TIMESTAMP_MS(timestamp_string [, timezone]):Converts a string representation of the time to a TIMESTAMP(3) type with millisecond precision.
103+
* TIMESTAMP_US(timestamp_string [, timezone]):Converts a string representation of the time to a TIMESTAMP(6) type with microsecond precision.
104+
* TIMESTAMP_NS(timestamp_string [, timezone]):Converts a string representation of the time to a TIMESTAMP(9) type with nanosecond precision.
105+
```
106+
107+
- TQL
108+
``` example
109+
* TIMESTAMP_MS(str):Converts a string representation of the time to a TIMESTAMP(3) type with millisecond precision.
110+
* TIMESTAMP_US(str):Converts a string representation of the time to a TIMESTAMP(6) type with microsecond precision.
111+
* TIMESTAMP_NS(str):Converts a string representation of the time to a TIMESTAMP(9) type with nanosecond precision.
112+
```
113+
114+
And The following functions now support calculations with microsecond and nanosecond precision:
115+
116+
- SQL
117+
``` example
118+
* TIMESTAMP_ADD(time_unit, timestamp, duration [, timezone])/TIMESTAMP_DIFF(time_unit, timestamp1, timestamp2 [, timezone])
119+
```
120+
121+
- TQL
122+
``` example
123+
* TIMESTAMPADD(time_unit, timestamp, duration)/TIMESTAMPDIFF(time_unit, timestamp1, timestamp2)
124+
Note: We have also added TIMESTAMP_ADD()/TIMESTAMP_DIFF(), which have the same names as the SQL functions.
125+
```
126+
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# GridDB CE 5.8
2+
3+
## 変更点
4+
5+
GridDB CE V5.8の主な変更点は以下のとおりです。
6+
7+
- SQL最適化の強化
8+
9+
SQL検索実行時におけるジョイン方向(駆動表・内部表)の最適化を強化しました。従来のSQLプランでは、ジョイン演算の方向はユーザが記述したSELECT文の内容や順序に基づき、ルールを用いて決定されていました。そのため、ユーザはルールを理解し、テーブル規模や絞込み条件に応じて適切なプランが生成されるようにSELECT文を記述する必要がありました。今回の強化により、検索実行中に算出されるロウ数(テーブル規模や絞込み条件を考慮した概算値)をコストとして計算し、このコストを基にジョイン方向を最適化したプランを生成できるようになりました。
10+
11+
- 時系列データ管理・検索機能の強化
12+
13+
SQL分析関数機能強化(移動平均演算):SQL実行機能における分析関数のオプション構文として、SQL標準で定義されているフレーム句(分析対象とするデータ範囲の件数・幅指定)に対応しました。これにより、SQLを用いた時系列データのトレンド分析が容易に実現できるようになりました。
14+
15+
日付演算機能の精度向上:現状のSQLによる日時型演算機能の一部で行えなかった、マイクロ秒・ナノ秒精度の演算が可能となりました。
16+
17+
---
18+
19+
## SQL最適化の強化
20+
21+
結合処理において、最初にアクセスするテーブルを駆動表、次にアクセスして結合するテーブルを内部表といいます。駆動表の決め方には、コストベースによる方法とルールベースによる方法の2種類あります。いずれを用いるかは以下を使って設定できます。
22+
- クラスタ定義ファイル(gs_cluster.json)
23+
- ヒント
24+
25+
クラスタ定義ファイル(gs_cluster.json)を使う場合:
26+
27+
* /sql/costBasedJoinDriving:SQLプラン生成の際、ジョイン方向(駆動表・内部表)の決定にコストベースによる方法を用いるかどうかを指定します。用いない(false)場合は、ルールベースを用いて駆動表を決定します。デフォルト値はコストベースによる方法(true)です。
28+
29+
ヒントを使う場合:
30+
31+
* CostBasedJoinDriving():コストベースによる方法で駆動表を決定します。
32+
* NoCostBasedJoinDriving():コストベースによる方法を用いないで、ルールベースによる方法で駆動表を決定します。
33+
34+
## 時系列データ管理・検索機能の強化
35+
36+
### SQL分析関数機能強化(移動平均演算)
37+
38+
分析関数にFRAME句が追加されました。
39+
40+
FRAME句はパーティション全体ではなくフレーム上で作動するウィンドウ関数に対して、ウィンドウフレームを構成する行の集合を指定します。
41+
42+
``` example
43+
関数 OVER ( [PARTITION BY 式1 ] [ ORDER BY 式2 ] [ FRAME句 ] )
44+
```
45+
46+
ここで、FRAME句の構文は以下の通りです。
47+
48+
``` example
49+
ROWS | RANGE <フレーム開始値> | BETWEEN <フレーム開始値> AND <フレーム終了値>
50+
```
51+
52+
フレーム開始値・終了値の構文は以下の通りです。
53+
54+
``` example
55+
UNBOUNDED PRECEDING | UNBOUNDED FOLLOWING | CURRENT ROW | <フレーム境界値1> PRECEDING | <フレーム境界値2> FOLLOWING
56+
```
57+
58+
- CURRENT ROW: 分析対象の現在位置のロウを示します
59+
- UNBOUNDED: パーティションの先頭もしくは末端を示します
60+
- PRECEDING/FOLLOWING: 前方もしくは後方を示します
61+
62+
フレーム境界値の構文は以下の通りです。
63+
64+
``` example
65+
値1 | ( 値2, 単位 )
66+
```
67+
68+
- 同名の集計関数と対応づく既存の分析関数すべてで、FRAME句を指定できます。
69+
70+
AVG、COUNT、MAX、MIN、SUM、TOTAL、STDDEV、VAR
71+
72+
- 同名の集計関数と対応付かない以下の分析関数では、FRAME句を指定できません。
73+
74+
ROW_NUMBER、LAG、LEAD
75+
76+
例)
77+
78+
各ロウの10件前までを集計対象とする移動平均を求める。
79+
80+
``` example
81+
SELECT
82+
AVG(value1)
83+
OVER(ORDER BY time)
84+
ROWS BETWEEN 10 PRECEDING AND CURRENT ROW
85+
FROM tbl1;
86+
```
87+
各ロウの10分前までを集計対象とする移動平均を求める。
88+
89+
``` example
90+
SELECT
91+
AVG(value1)
92+
OVER(ORDER BY time)
93+
RANGE BETWEEN (10, MINUTE) PRECEDING AND CURRENT ROW
94+
FROM tbl1;
95+
```
96+
97+
### 日付演算機能の精度向上
98+
99+
SQLおよびTQLに以下の関数を追加しました。
100+
101+
- SQL
102+
``` example
103+
* TIMESTAMP_MS(timestamp_string [, timezone]):時刻の文字列表現timestamp_stringの値を、ミリ秒精度のTIMESTAMP(3)型に変換します。
104+
* TIMESTAMP_US(timestamp_string [, timezone]):時刻の文字列表現timestamp_stringの値を、マイクロ秒精度のTIMESTAMP(6)型に変換します。
105+
* TIMESTAMP_NS(timestamp_string [, timezone]):時刻の文字列表現timestamp_stringの値を、ナノ秒精度のTIMESTAMP(9)型に変換します。
106+
```
107+
108+
- TQL
109+
``` example
110+
* TIMESTAMP_MS(str):時刻の文字列表現をミリ秒精度のTIMESTAMP(3)型に変換します。
111+
* TIMESTAMP_US(str):時刻の文字列表現をマイクロ秒精度のTIMESTAMP(6)型に変換します。
112+
* TIMESTAMP_NS(str):時刻の文字列表現をナノ秒精度のTIMESTAMP(9)型に変換します。
113+
```
114+
115+
また、以下の関数でマイクロ秒・ナノ秒精度の演算が可能となりました。
116+
117+
- SQL
118+
``` example
119+
* TIMESTAMP_ADD(time_unit, timestamp, duration [, timezone])/TIMESTAMP_DIFF(time_unit, timestamp1, timestamp2 [, timezone])
120+
```
121+
122+
- TQL
123+
``` example
124+
* TIMESTAMPADD(time_unit, timestamp, duration)/TIMESTAMPDIFF(time_unit, timestamp1, timestamp2)
125+
※ SQLの関数と同名のTIMESTAMP_ADD()/TIMESTAMP_DIFF()も追加しました。
126+
```
127+

0 commit comments

Comments
 (0)