Partitioning for Large Tables

by

in

Explanation: Partitioning divides large tables into smaller, more manageable pieces.

  • Why It Matters: It enhances query performance and makes maintenance tasks like archiving easier.
  • Example: Partition a table by range:
CREATE TABLE sales (
sale_id NUMBER,
sale_date DATE,
amount NUMBER
) PARTITION BY RANGE (sale_date) (
PARTITION p1 VALUES LESS THAN (TO_DATE('2022-01-01', 'YYYY-MM-DD')),
PARTITION p2 VALUES LESS THAN (TO_DATE('2023-01-01', 'YYYY-MM-DD'))
);

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *