17. Page | 17
17
OLTPとOLAPを同時に処理する仕組み
デルタマージ(Merge delta of テーブル名)
VALUE
123471
IDカラム
VALUE
123441
123452
123463
123452 X
〇
デルタストア
メインストア
123452
IDカラム
New Delta
New Main
VALUE
123441
123452
123463
123474
マージ中の更新は、
New Deltaへ
VALUE
888881
999992
アニメーション
ここで、カラムストア更新の高速化の各機能やリソースを実感してもらうために簡単なデモをします。
ORDERSというテーブルを作成し、データをインポートします。
その間、Ordersテーブルの状態を見てみます。
Memory Consumption in Main Storageがメインストア、Memory Consumption in Delta Storageがデルタストアでそれぞれキロバイトでデータ量を表し、現在データは15万件で、その全てがデルタストアにあり約 33MB消費しています。
ここで、デルタマージを実行(右下)すると、データはメインに移動し、圧縮されて9MBをしめていることがわかります。
また、デルタマージの前後で全件読込の集計を行うと、メインの方がデルタより高億であることが分かります。
--デルタで実行
Statement 'select o.o_custkey, sum(o.o_totalprice) from ( select top 150000 * from orders order by o_custkey ) ...'
successfully executed in 402 ms 643 µs (server processing time: 400 ms 227 µs)
--メインで実行
Statement 'select o.o_custkey, sum(o.o_totalprice) from ( select top 150000 * from orders order by o_custkey ) ...'
successfully executed in 136 ms 618 µs (server processing time: 134 ms 336 µs)