8 Oracle Partitioning / Version 1.0
Copyright © 2023, Oracle and/or its affiliates / Public
Partitioning can also improve the performance of multi-table joins, by
using a technique known as partition-wise joins. Partition-wise joins
can be applied when two tables are being joined together, and at least
one of these tables is partitioned on the join key. Partition-wise joins
break a large join into smaller joins of 'identical' data sets for the
joined tables. 'Identical' here is defined as covering exactly the same
set of partitioning key values on both sides of the join, thus ensuring
that only a join of these 'identical' data sets will produce a result and
that other data sets do not have to be considered. Oracle is using
either the fact of already (physical) equi-partitioned tables for the join
or is transparently redistributing (= "repartitioning") one table – the
smaller one - at runtime to create equi-partitioned data sets matching
the partitioning of the other table, completing the overall join in less time, using less resources. This offers significant
performance benefits both for serial and parallel execution.
Automatic Partitioning, part of Oracle Autonomous Database, allows you to rely on your database to pick the most
optimal partitioning strategy for your workload for performance. It analyzes and automates the partition creation for
tables and indexes without any user intervention; it does not require any user interaction or maintenance.
Partitioning for Manageability
By partitioning tables and indexes into smaller, more manageable units, database administrators can use a "divide
and conquer" approach to data management. Oracle provides a comprehensive set of SQL commands for managing
partitioning tables. These include commands for adding new partitions, dropping, splitting, moving, merging,
truncating, and exchanging partitions.
With partitioning, maintenance operations can be focused on particular parts of tables. For example, a database
administrator could compress a single partition containing say the data for the year 2024 of a table, rather than
compressing the entire table; as part of the compression operation, this partition could also be moved to a lower cost
storage tier, reducing the total cost of ownership for the stored data even more. This partition maintenance operation
can be done in a completely online fashion, allowing both queries and DML operations to occur while the data
maintenance operation is in process.
You can execute partition maintenance operations on multiple partitions as single atomic operation: for example, you
can merge the three partitions' January 2024', 'February 2024', and 'March 2024' into a single partition 'Q1 2024'
with a single merge partition operation.
Another typical usage of partitioning for manageability is to support a 'rolling window' load process in a data
warehouse. Suppose that you load new data into a table on daily basis. That table could be range-partitioned so that
each partition contains one day of data. The load process is simply the addition of a new partition. Adding a single
partition is much more efficient than modifying the entire table, since you do not need to modify any other partitions.
Removing data in a very efficient and elegant manner is another key advantage of partitioning. For example, to purge
data from a partitioned table you simply drop or truncate one or multiple partitions, a very cheap and quick data
dictionary operation, rather than issuing the equivalent delete command, using lots of resources and touching all the
rows to being deleted. The common operation of removing data with a partition maintenance operation such as drop
or truncate is optimized: these operations do not require any immediate global index maintenance to keep all indexes
valid, making it fast metadata-only operations
5
.
5
Asynchronous global index maintenance is discussed in the VLDB and Partitioning Guide
Figure 3: Sample partition-wise join