05.11.2015 Views

Apress.Expert.Oracle.Database.Architecture.9i.and.10g.Programming.Techniques.and.Solutions.Sep.2005

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

582<br />

CHAPTER 13 ■ PARTITIONING<br />

Composite partitioning is useful when you have something logical by which you can<br />

range partition, but the resulting range partitions are still too large to manage effectively. You<br />

can apply the range partitioning <strong>and</strong> then further divide each range by a hash function or use<br />

lists to partition. This will allow you to spread out I/O requests across many disks in any given<br />

large partition. Additionally, you may achieve partition elimination at three levels now. If you<br />

query on the range partition key, <strong>Oracle</strong> is able to eliminate any range partitions that do not<br />

meet your criteria. If you add the hash or list key to your query, <strong>Oracle</strong> can eliminate the other<br />

hash or list partitions within that range. If you just query on the hash or list key (not using the<br />

range partition key), <strong>Oracle</strong> will query only those hash or list subpartitions that apply from<br />

each range partition.<br />

It is recommended that, if there is something by which it makes sense to range partition<br />

your data, you should use that over hash or list partitioning. Hash <strong>and</strong> list partitioning add<br />

many of the salient benefits of partitioning, but they are not as useful as range partitioning<br />

when it comes to partition elimination. Using hash or list partitions within range partitions is<br />

advisable when the resulting range partitions are too large to manage, or when you want to<br />

use all PDML capabilities or parallel index scanning against a single range partition.<br />

Partitioning Indexes<br />

Indexes, like tables, may be partitioned. There are two possible methods to partition indexes:<br />

• Equipartition the index with the table: This is also known as a locally partitioned index.<br />

For every table partition, there will be an index partition that indexes just that table<br />

partition. All of the entries in a given index partition point to a single table partition,<br />

<strong>and</strong> all of the rows in a single table partition are represented in a single index partition.<br />

• Partition the index by range: This is also known as a globally partitioned index. Here the<br />

index is partitioned by range, or optionally in <strong>Oracle</strong> 10g by hash, <strong>and</strong> a single index<br />

partition may point to any (<strong>and</strong> all) table partitions.<br />

Figure 13-5 demonstrates the difference between a local <strong>and</strong> a global index.<br />

Figure 13-5. Local <strong>and</strong> global index partitions

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!