8

クエリのターゲットとなることが多い数値列をパーティション化することでパフォーマンスが向上するかどうかを知りたいと思います。現在、約5,000万件のレコードを含むマテリアライズドビューがあります。通常のbツリーインデックスを使用してこの数値列で検索すると、7のコストが発生し、クエリ結果は約0.8秒で取得されます(プライミングされていないキャッシュを使用)。その列にグローバルハッシュパーティション(64パーティション)を追加した後、6のコストが発生し、クエリ結果は約0.2秒で完了します(これもプライミングされていないキャッシュを使用)。

私の最初の反応は、パーティションインデックスによってクエリのパフォーマンスが向上したことです。ただし、これは単なる偶然であり、検索対象の値、または私が知らない他の値に完全に依存している可能性があることを認識しています。だから私の質問は次のとおりです:大きなテーブルの数値列にグローバルハッシュパーティションを追加することにはパフォーマンス上の利点がありますか、それともスキャンするインデックスパーティションを決定するコストが、インデックス付けされていないパーティション?

これは、多くのOracleの質問と同様に、「状況によって異なります」で答えられると確信しています。:)私は各アプローチの利点を決定するために考慮すべき要素を学ぶことに興味があります。

ありがとう!

4

1 に答える 1

4

I'm pretty sure you have found this reference in your research - Partitioned Tables and Indexes. However I give a link to it if somebody is interested, this is a very good material about partitioning.

Straight to the point - Partitioned index just decomposes the index into pieces (16 in your situation) and spread the data depending on their hashed partitioning key. When you want to use it, Oracle "calculates" the hash of the key and determine in which section to continue with searching.

Knowing how index searching works, on really huge data I think it is better to choose the partitioned index in order to decrease the index tree you traverse (regular index). It really depends on the data, which is in the table (how regular index tree is composed) and is hashing and direct jump to lower node faster than regular tree traverse from the start node.

Finally, you must be more confident with the test results. If one technique gives better results on your exact data than some other don't worry to implement it.

于 2009-09-02T12:50:10.443 に答える