問題タブ [columnstore]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
3 に答える
2323 参照

sql - Columnstore index - slow performance on offset-fetch query

We have Fact table around 35M rows on Azure database (premium tier), this table has cluster columnstore index enabled in order to boost query performance.

We did pagination (to index on Elastic Search) on Fact table using similar below code:

But this query performs so slow, even over 10 minutes, it's not finished. If we change to use TOP, it works really well and take around 30 seconds:

The estimated execution plan for offset-fetch query:

enter image description here

I am not sure that I understand whether offset-fetch query performs very poorly on cluster columnstore index or not.

This table also have a lot of none-cluster B-tree indexes on foreign keys and one unique index on the Id of Fact table in order to boost performance

This execution plan for offset-fetch query:

https://pastebin.com/BM8MXQMg

0 投票する
3 に答える
2286 参照

sql-server - 列ストア インデックスが使用されない理由

SQL Server 2016 Enterprise Edition の 40m レコードの非メモリ最適化テーブルのすべての列に非クラスター化列ストア インデックスがあります。

列ストア インデックスの使用を強制するクエリは大幅に高速に実行されますが、オプティマイザーは引き続きクラスター化インデックスとその他の非クラスター化インデックスの使用を選択します。利用可能な RAM がたくさんあり、次元モデルに対して適切なクエリを使用しています。

オプティマイザーが columnstoreindex を選択しないのはなぜですか? そして、どうすればその使用を奨励できますか (ヒントを使用せずに)?

列ストアを使用しないサンプル クエリを次に示します。

ヒントなしで 7 秒、ヒントありで数分の 1 秒かかります。ヒントなしのクエリ プランはこちらです。ヒント付きのクエリ プランはこちらです。

列ストア インデックスの作成ステートメントは次のとおりです。

アップデート。Count(*) の代わりに Count(EquityTradeID) を使用 し、ヒントを含めて計画する