Can we create a unique index on a partitioned table

Can we insert duplicate values into different partitions of an Oracle partitioned table when using LOCAL and GLOBAL UNIQUE INDEXES?

This is an important Oracle interview question. The behavior is different depending on whether we use a LOCAL or GLOBAL unique index.

Let's understand this concept with practical SQL INSERT examples.

1. Create a Partitioned Employee Table

First, create an EMPLOYEE table partitioned by JOIN_DATE.

CREATE TABLE employee (
    emp_id     NUMBER,
    emp_name   VARCHAR2(100),
    salary     NUMBER,
    join_date  DATE
)
PARTITION BY RANGE (join_date)
(
    PARTITION p2024
    VALUES LESS THAN (DATE '2025-01-01'),

    PARTITION p2025
    VALUES LESS THAN (DATE '2026-01-01'),

    PARTITION pmax
    VALUES LESS THAN (MAXVALUE)
);

Here are the table details:

  • Table name: EMPLOYEE
  • Partitioning column: JOIN_DATE
  • Partitioning method: RANGE
  • Partitions: P2024, P2025 and PMAX

2. Create a GLOBAL UNIQUE INDEX

Suppose we want EMP_ID to be unique across the entire EMPLOYEE table.

CREATE UNIQUE INDEX emp_uidx
ON employee (emp_id)
GLOBAL;
Result: Allowed

Oracle allows this because a GLOBAL unique index can enforce uniqueness across all table partitions without including the partitioning column.

3. Insert Initial Records

Let's insert two employees into different partitions.

INSERT INTO employee
VALUES (101, 'John', 50000,
        DATE '2024-06-15');

INSERT INTO employee
VALUES (102, 'David', 60000,
        DATE '2025-03-10');

COMMIT;

These records are stored in different partitions.

EMP_ID EMP_NAME JOIN_DATE Partition
101 John 15-JUN-2024 P2024
102 David 10-MAR-2025 P2025

4. Try to Insert a Duplicate EMP_ID

Now, try inserting EMP_ID = 101 into another partition.

INSERT INTO employee
VALUES (101, 'Peter', 70000,
        DATE '2025-05-15');
Result: INSERT Fails

Oracle raises a unique constraint violation because EMP_ID = 101 already exists in another partition.

ORA-00001: unique constraint violated

Why Does This Happen?

  • EMP_ID is the unique index column.
  • The index is GLOBAL.
  • Global uniqueness is checked across all partitions.
  • Therefore, duplicate EMP_ID values are not allowed anywhere in the table.
Important:

A GLOBAL UNIQUE INDEX guarantees uniqueness across the complete partitioned table, not just within an individual partition.

5. Create a LOCAL UNIQUE INDEX

Now let's understand the behavior of a LOCAL UNIQUE INDEX.

First, drop the previous global index.

DROP INDEX emp_uidx;

Create a LOCAL unique index on EMP_ID and JOIN_DATE.

CREATE UNIQUE INDEX emp_uidx_local
ON employee (emp_id, join_date)
LOCAL;
Result: Allowed

This index is allowed because JOIN_DATE, the table partitioning column, is included in the unique index key.

6. Insert Duplicate EMP_ID Values with Different JOIN_DATE Values

Let's insert the following records.

INSERT INTO employee
VALUES (101, 'John', 50000,
        DATE '2024-06-15');

INSERT INTO employee
VALUES (101, 'Peter', 70000,
        DATE '2025-05-15');

COMMIT;
Result: Both INSERT Statements Succeed

Why? Because the complete unique key combinations are different.

EMP_ID EMP_NAME JOIN_DATE Partition
101 John 15-JUN-2024 P2024
101 Peter 15-MAY-2025 P2025

Why Are Duplicate EMP_ID Values Allowed?

The LOCAL unique index is defined on:

(EMP_ID, JOIN_DATE)

Therefore, Oracle checks the complete combination rather than EMP_ID alone.

The two combinations are:

  • (101, 15-JUN-2024)
  • (101, 15-MAY-2025)

Since the complete combinations are different, both records are allowed.

Remember:

A composite unique index guarantees uniqueness of the complete combination. It does not guarantee that every individual column is unique.

7. Try to Insert the Same Composite Key Again

Now try inserting exactly the same EMP_ID and JOIN_DATE combination.

INSERT INTO employee
VALUES (101, 'Smith', 80000,
        DATE '2025-05-15');
Result: INSERT Fails

Oracle raises ORA-00001 because the combination (101, 15-MAY-2025) already exists.

Even though the table is partitioned, a LOCAL unique index prevents duplicate complete key combinations within the relevant partition.

8. What Happens If We Create a LOCAL UNIQUE INDEX on EMP_ID Alone?

Consider the following statement:

CREATE UNIQUE INDEX emp_uidx_local
ON employee (emp_id)
LOCAL;
Result: Not Allowed

Oracle rejects this statement because the LOCAL unique index does not include the table partitioning column JOIN_DATE.

A LOCAL unique index must include all partitioning key columns in its unique key.

9. LOCAL vs GLOBAL UNIQUE INDEX: INSERT Behavior

Scenario LOCAL UNIQUE GLOBAL UNIQUE
Duplicate EMP_ID in different partitions Allowed if JOIN_DATE differs Rejected
Duplicate EMP_ID and JOIN_DATE in same partition Rejected Rejected when indexed columns match
Unique key excludes partitioning column Not allowed Allowed
Unique key includes partitioning column Allowed Allowed

10. Important Oracle Interview Questions

Question 1: Can duplicate EMP_ID values exist in different partitions with a GLOBAL UNIQUE INDEX?

Answer: No. A GLOBAL unique index enforces uniqueness across the entire table.


Question 2: Can duplicate EMP_ID values exist in different partitions with a LOCAL UNIQUE INDEX?

Answer: Yes, provided the complete unique key combinations are different. For example, (101, 2024-06-15) and (101, 2025-05-15).


Question 3: Can we create a LOCAL UNIQUE INDEX on EMP_ID alone when the table is partitioned by JOIN_DATE?

Answer: No. The LOCAL unique index must include JOIN_DATE.


Question 4: Does a composite LOCAL UNIQUE INDEX guarantee EMP_ID uniqueness?

Answer: No. It guarantees uniqueness of the complete combination of EMP_ID and JOIN_DATE.


Question 5: Which index should we use if EMP_ID must be globally unique?

Answer: Use a GLOBAL unique index on EMP_ID, or another suitable global uniqueness design.

11. Test Your Understanding

Interview Question:

An EMPLOYEE table is partitioned by JOIN_DATE. A LOCAL UNIQUE INDEX is created on (EMP_ID, JOIN_DATE).

Two records are inserted:

INSERT INTO employee
VALUES (101, 'John', 50000,
        DATE '2024-06-15');

INSERT INTO employee
VALUES (101, 'Peter', 70000,
        DATE '2025-05-15');

What will happen?

12. Final Conclusion

Remember These Important Rules

1. A GLOBAL UNIQUE INDEX enforces uniqueness across all partitions.

2. A LOCAL UNIQUE INDEX must include all table partitioning key columns.

3. Duplicate individual EMP_ID values can exist with a composite LOCAL UNIQUE INDEX if the complete key combinations differ.

4. Duplicate complete key combinations are rejected by both LOCAL and GLOBAL unique indexes.

GLOBAL UNIQUE INDEX = Global Uniqueness
LOCAL UNIQUE INDEX = Partition-Aligned Uniqueness

Understanding these INSERT examples will help you answer Oracle partitioning and indexing interview questions confidently.

Next Topic: What Happens to LOCAL and GLOBAL Indexes When We DROP or TRUNCATE a Partition in Oracle?

Can we create a primary key on a partitioned table

Yes! Oracle supports primary keys on partitioned tables. However, there is an important restriction depending on whether we use a LOCAL or GLOBAL unique index.

The table partitioning column determines whether a local unique index can enforce the primary key.

Let's understand with practical examples.

1. Create a Partitioned Table

Suppose we create an EMPLOYEE table partitioned by JOIN_DATE.

Creating the Table

CREATE TABLE employee (
    emp_id     NUMBER,
    emp_name   VARCHAR2(100),
    salary     NUMBER,
    join_date  DATE
)
PARTITION BY RANGE (join_date)
(
    PARTITION p2024
    VALUES LESS THAN (DATE '2025-01-01'),

    PARTITION p2025
    VALUES LESS THAN (DATE '2026-01-01'),

    PARTITION pmax
    VALUES LESS THAN (MAXVALUE)
);

Here:

  • Table name = EMPLOYEE
  • Partition key = JOIN_DATE
  • Partitioning method = RANGE
  • Number of partitions = 3
Remember:

Our EMPLOYEE table is partitioned using JOIN_DATE.

Now let's create a primary key on EMP_ID.

2. Create a Primary Key on EMP_ID Only

Suppose we want EMP_ID to be the primary key of the EMPLOYEE table.

ALTER TABLE employee
ADD CONSTRAINT emp_pk
PRIMARY KEY (emp_id);

Will This Work?

Yes! Oracle can create a GLOBAL unique index to enforce this primary key.

Why does Oracle need a global index?

  • Table partition key = JOIN_DATE.
  • Primary key column = EMP_ID.
  • EMP_ID does not include the table partitioning column.
  • A LOCAL unique index on EMP_ID alone cannot enforce uniqueness across all table partitions.

Therefore, Oracle can use a global unique index to enforce the primary key.

GLOBAL UNIQUE INDEX

Enforces EMP_ID uniqueness across all table partitions.

Important:

A GLOBAL unique index can enforce uniqueness across the entire partitioned table, even when the primary key does not contain the table partitioning column.

3. Create a Primary Key Including the Partitioning Column

Now consider a different scenario.

We include both EMP_ID and JOIN_DATE in the primary key.

ALTER TABLE employee
ADD CONSTRAINT emp_pk
PRIMARY KEY (emp_id, join_date);

Will This Work?

Yes! In this case, Oracle can use a LOCAL unique index because the primary key includes the table partitioning column.

Let's explicitly create the local unique index.

CREATE UNIQUE INDEX emp_pk_idx
ON employee (emp_id, join_date)
LOCAL;

Now add the primary key constraint using the existing index.

ALTER TABLE employee
ADD CONSTRAINT emp_pk
PRIMARY KEY (emp_id, join_date)
USING INDEX emp_pk_idx;

Why Does This Work?

  • Table partition key = JOIN_DATE.
  • Primary key columns = EMP_ID, JOIN_DATE.
  • The partitioning column is included in the primary key.
  • Each local unique index partition can enforce uniqueness within its corresponding table partition.
Important Rule:

A LOCAL unique index on a partitioned table must include all the table partitioning key columns in its index key.

4. LOCAL vs GLOBAL Index for Primary Keys

Let's compare LOCAL and GLOBAL unique indexes.

Feature LOCAL Unique Index GLOBAL Unique Index
Partitioning Follows table partitions Independent of table partitions or nonpartitioned
Partition key requirement Must include all table partitioning key columns No such requirement
Uniqueness Enforced within each index partition Enforced across the entire table
Primary key without partition key Not supported with a local unique index Supported
Partition maintenance Generally easier May require additional maintenance
Interview Point:

If the primary key does not include the table partitioning column, Oracle needs a GLOBAL unique index to enforce uniqueness across all partitions.

If the primary key includes all partitioning key columns, a LOCAL unique index is possible.

5. What Happens When We Insert Duplicate EMP_ID Values?

This is an important practical example.

Suppose the table has the following records:

EMP_ID EMP_NAME JOIN_DATE
101 John 15-JAN-2024
102 David 10-FEB-2025
103 Smith 20-MAR-2025

Now try inserting the same EMP_ID into another partition.

INSERT INTO employee
VALUES (101, 'Peter', 50000, DATE '2025-05-15');

What Happens?

If the primary key is defined as:

PRIMARY KEY (emp_id)

Oracle rejects the duplicate EMP_ID, even though the new record belongs to a different table partition.

This is because the global unique index enforces uniqueness across the entire table.

However, if the primary key is:

PRIMARY KEY (emp_id, join_date)

The following two values are different composite keys:

  • (101, 15-JAN-2024)
  • (101, 15-MAY-2025)

Therefore, both records can exist because the complete primary key combinations are different.

Remember:

A composite primary key guarantees uniqueness of the complete combination, not necessarily uniqueness of each individual column.

6. Real-Time Example: Banking Application

Imagine a banking application with millions of employee or transaction records.

The table is partitioned using a date column.

PARTITION BY RANGE (transaction_date)

Now suppose the business requires a globally unique transaction ID.

We create a primary key on TRANSACTION_ID only.

ALTER TABLE transactions
ADD CONSTRAINT transactions_pk
PRIMARY KEY (transaction_id);

Oracle can use a GLOBAL unique index because TRANSACTION_ID does not include TRANSACTION_DATE.

Alternatively, if the primary key is defined as:

PRIMARY KEY (transaction_id, transaction_date)

A LOCAL unique index can be used because the partitioning column is included.

Real-Time Understanding:

Use a global unique index when uniqueness must be enforced across all partitions using a key that does not include the partitioning column.

Use a local unique index when the complete unique key includes all partitioning key columns.

7. How to Identify the Index Created for a Primary Key?

First, check the primary key constraint:

SELECT
    CONSTRAINT_NAME,
    TABLE_NAME,
    CONSTRAINT_TYPE,
    INDEX_NAME
FROM USER_CONSTRAINTS
WHERE TABLE_NAME = 'EMPLOYEE'
AND CONSTRAINT_TYPE = 'P';

Next, check the index information:

SELECT
    INDEX_NAME,
    TABLE_NAME,
    UNIQUENESS,
    PARTITIONED
FROM USER_INDEXES
WHERE TABLE_NAME = 'EMPLOYEE';

To check whether the index is LOCAL or GLOBAL:

SELECT
    INDEX_NAME,
    TABLE_NAME,
    LOCALITY,
    ALIGNMENT
FROM USER_PART_INDEXES
WHERE TABLE_NAME = 'EMPLOYEE';

These queries help identify the primary key constraint and its associated index.

8. Important Oracle Interview Questions

Question 1: Can we create a primary key on a partitioned table in Oracle?

Answer: Yes. Oracle supports primary keys on partitioned tables. The unique index used to enforce the constraint can be LOCAL or GLOBAL, subject to the partitioning key restrictions.


Question 2: Can we create a primary key on EMP_ID alone when the table is partitioned by JOIN_DATE?

Answer: Yes. Oracle can use a GLOBAL unique index because EMP_ID does not contain the table partitioning column.


Question 3: Can we create a LOCAL unique index on EMP_ID alone?

Answer: No. A LOCAL unique index must include all partitioning key columns.


Question 4: Can we create a LOCAL unique index on (EMP_ID, JOIN_DATE)?

Answer: Yes. Because JOIN_DATE is included in the unique index key.


Question 5: Which index enforces uniqueness across all partitions?

Answer: A GLOBAL unique index can enforce uniqueness across all partitions.

9. Test Your Understanding

Interview Question:

Your EMPLOYEE table is partitioned by JOIN_DATE.

You want to create a primary key on EMP_ID alone.

Which index can Oracle use to enforce this primary key?

10. Conclusion

Final Summary

Oracle supports primary keys on partitioned tables using LOCAL or GLOBAL unique indexes.

If the primary key does not include the table partitioning column, Oracle can use a GLOBAL unique index.

If the primary key includes all table partitioning key columns, Oracle can use a LOCAL unique index.

LOCAL UNIQUE INDEX = Includes All Table Partitioning Key Columns
GLOBAL UNIQUE INDEX = Can Enforce Uniqueness Across All Partitions

Understanding this restriction is important for Oracle database development, partition maintenance, and technical interviews.

Next Topic: What Happens to Primary Keys and Indexes When We Drop or Truncate a Partition in Oracle?

What is a global non-prefixed index

A GLOBAL NON-PREFIXED INDEX in Oracle is a global partitioned index in which the leading (first) column of the index is different from the index partition key.

In simple words:

If the first column of a global partitioned index is not the same as the index partitioning key, it is called a Global Non-Prefixed Index.

Let's understand with a practical example.

1. Create a Partitioned Table

Suppose we have an ORDERS table partitioned by ORDER_DATE.

Creating the Table

CREATE TABLE orders (
    order_id NUMBER,
    order_date DATE,
    customer_id NUMBER,
    amount NUMBER
)
PARTITION BY RANGE (order_date)
(
    PARTITION p_jan
    VALUES LESS THAN (DATE '2025-02-01'),

    PARTITION p_feb
    VALUES LESS THAN (DATE '2025-03-01'),

    PARTITION p_mar
    VALUES LESS THAN (DATE '2025-04-01'),

    PARTITION p_apr
    VALUES LESS THAN (DATE '2025-05-01')
);

Here:

  • Table partition key = ORDER_DATE
  • Table partitioning method = RANGE
  • Number of table partitions = 4
Remember:

The ORDERS table is partitioned using ORDER_DATE. Our global index will use a different partitioning key.

2. Create a Global Non-Prefixed Index

Now create a global partitioned index using CUSTOMER_ID as the index partition key.

CREATE INDEX idx_orders_global_np
ON orders (order_id, customer_id)
GLOBAL PARTITION BY RANGE (customer_id)
(
    PARTITION ip1 VALUES LESS THAN (1000),

    PARTITION ip2 VALUES LESS THAN (2000),

    PARTITION ip3 VALUES LESS THAN (3000),

    PARTITION ip4 VALUES LESS THAN (MAXVALUE)
);

Understand the Index Definition

Property Value
Table partition key ORDER_DATE
Index columns ORDER_ID, CUSTOMER_ID
Index partition key CUSTOMER_ID
Index partitioning method RANGE
Index type Global partitioned
Index structure Non-prefixed

Why Is This a Global Non-Prefixed Index?

  • Index partition key = CUSTOMER_ID.
  • First index column = ORDER_ID.
  • These columns are different.
Important:

The first index column does not match the global index partition key. Therefore, this is a Global Non-Prefixed Index.

3. How Does a Global Non-Prefixed Index Work?

ORDERS Table

Range partitioning using ORDER_DATE

P_JAN
January table partition
P_FEB
February table partition
P_MAR
March table partition
P_APR
April table partition

GLOBAL INDEX

Range partitioning using CUSTOMER_ID

IP1
CUSTOMER_ID less than 1000
IP2
CUSTOMER_ID from 1000 to less than 2000
IP3
CUSTOMER_ID from 2000 to less than 3000
IP4
CUSTOMER_ID 3000 and above

Independent partition structures:

The global index is partitioned by CUSTOMER_ID, but its first index column is ORDER_ID.

Notice:

  • Table partitions are based on ORDER_DATE.
  • Index partitions are based on CUSTOMER_ID.
  • Index column order is (ORDER_ID, CUSTOMER_ID).
  • There is no one-to-one relationship between table and index partitions.

A global index partition can contain index entries pointing to rows in multiple table partitions.

4. How Does Oracle Search This Index?

Suppose we execute the following query:

SELECT *
FROM orders
WHERE customer_id = 1500;

What Happens Internally?

  1. Oracle checks the global index partition boundaries.
  2. It can identify IP2 because CUSTOMER_ID 1500 falls between 1000 and 2000.
  3. Oracle can prune the other global index partitions.
  4. However, CUSTOMER_ID is not the leading index column.
  5. The index is ordered first by ORDER_ID and then by CUSTOMER_ID.
  6. Oracle may not be able to perform an efficient ordinary index range scan using CUSTOMER_ID alone.
Important Interview Point:

Even though Oracle can prune to the relevant global index partition, that does not mean it can efficiently search index entries using CUSTOMER_ID alone.

Index column order matters when determining whether an efficient index access path is available.

5. Global Prefixed vs Global Non-Prefixed Index

Suppose the global index partition key is CUSTOMER_ID.

Index Definition Index Type
(CUSTOMER_ID, ORDER_ID) Global Prefixed
(ORDER_ID, CUSTOMER_ID) Global Non-Prefixed
(CUSTOMER_ID) Global Prefixed
(ORDER_ID) Global Non-Prefixed

The difference is the position of the index partition key in the index columns.

Easy Memory Trick:

If the index partition key is the first index column, it is Global Prefixed.

If the index partition key is not the first index column, it is Global Non-Prefixed.

6. Local Non-Prefixed vs Global Non-Prefixed

Feature Local Non-Prefixed Global Non-Prefixed
Index type Local Global
Partition structure Follows table Independent
First index column Not table partition key Not global index partition key
Index partitions Correspond to table partitions Independently defined
Maintenance Generally easier May require additional maintenance

7. How to Identify Global Non-Prefixed Indexes?

First, check the index partitioning information:

SELECT
    INDEX_NAME,
    TABLE_NAME,
    LOCALITY,
    ALIGNMENT
FROM USER_PART_INDEXES
WHERE TABLE_NAME = 'ORDERS';

Next, check the index columns and their positions:

SELECT
    INDEX_NAME,
    COLUMN_NAME,
    COLUMN_POSITION
FROM USER_IND_COLUMNS
WHERE TABLE_NAME = 'ORDERS'
ORDER BY INDEX_NAME, COLUMN_POSITION;

Compare the first index column with the index partition key to determine whether the global index is prefixed or non-prefixed.

Remember:

USER_PART_INDEXES provides index locality and alignment information. USER_IND_COLUMNS provides the index column order. You need the index partitioning definition to identify the partition key.

8. Interview-Ready Answer

Interviewer Question:

What is a Global Non-Prefixed Index in Oracle?

Answer:

"A Global Non-Prefixed Index is a global partitioned index in which the leading column of the index is different from the index partitioning key.

For example, if we create a global range-partitioned index using CUSTOMER_ID as the partition key, but define the index columns as (ORDER_ID, CUSTOMER_ID), it becomes a Global Non-Prefixed Index.

Oracle maintains an independent index partition structure from the underlying table."

9. Test Your Understanding

Interview Question:

Your global index is partitioned by TRANSACTION_DATE.

Which definition represents a Global Non-Prefixed Index?

10. Conclusion

Final Summary

A Global Non-Prefixed Index in Oracle is a global partitioned index in which the first index column is different from the index partitioning key.

For example, if the global index partition key is CUSTOMER_ID and the index columns are (ORDER_ID, CUSTOMER_ID), it is a Global Non-Prefixed Index.

Unlike local indexes, global indexes maintain an independent partitioning structure from the underlying table.

GLOBAL NON-PREFIXED INDEX = First Index Column ≠ Index Partition Key

Next Topic: All Oracle Index Types with a Comparison Diagram.

What is a global prefixed index

A GLOBAL PREFIXED INDEX is a global partitioned index in which the leftmost (first) column of the index is the same as the partition key of the index.

In simple words:

If the first column of a global partitioned index matches its own index partitioning key, it is called a Global Prefixed Index.

Important difference: For a global index, we compare the first index column with the global index's partition key, not necessarily the table's partition key.

Let's understand with a practical example.

1. Create a Partitioned Table

Suppose we have an ORDERS table partitioned by ORDER_DATE.

Creating the Table

CREATE TABLE orders (
    order_id NUMBER,
    order_date DATE,
    customer_id NUMBER,
    amount NUMBER
)
PARTITION BY RANGE (order_date)
(
    PARTITION p_jan
    VALUES LESS THAN (DATE '2025-02-01'),

    PARTITION p_feb
    VALUES LESS THAN (DATE '2025-03-01'),

    PARTITION p_mar
    VALUES LESS THAN (DATE '2025-04-01'),

    PARTITION p_apr
    VALUES LESS THAN (DATE '2025-05-01')
);

Here:

  • Table partition key = ORDER_DATE
  • Table partitioning method = RANGE
  • Number of table partitions = 4
Remember:

Table partition key = ORDER_DATE

Table partitioning method = RANGE

Number of table partitions = 4

2. Create a Global Prefixed Index

Now create a global partitioned index on CUSTOMER_ID.

CREATE INDEX idx_orders_global
ON orders (customer_id, order_id)
GLOBAL PARTITION BY RANGE (customer_id)
(
    PARTITION ip1 VALUES LESS THAN (1000),
    PARTITION ip2 VALUES LESS THAN (2000),
    PARTITION ip3 VALUES LESS THAN (3000),
    PARTITION ip4 VALUES LESS THAN (MAXVALUE)
);

Understand the Index Definition

Property Value
Table partition key ORDER_DATE
Index columns CUSTOMER_ID, ORDER_ID
Index partition key CUSTOMER_ID
Index partitioning method RANGE
Index type Global partitioned
Index structure Prefixed

Why Is This a Global Prefixed Index?

Because:

  • Global index partition key = CUSTOMER_ID.
  • First index column = CUSTOMER_ID.
  • Both match.
Index Partition Key = CUSTOMER_ID

First Index Column = CUSTOMER_ID

Therefore, it is a Global Prefixed Index.

3. How Does a Global Prefixed Index Work?

ORDERS Table

Range partitioning on ORDER_DATE.

P_JAN

January table partition

P_FEB

February table partition

P_MAR

March table partition

P_APR

April table partition

GLOBAL INDEX

Range partitioning on CUSTOMER_ID.

IP1

CUSTOMER_ID less than 1000

IP2

CUSTOMER_ID from 1000 to less than 2000

IP3

CUSTOMER_ID from 2000 to less than 3000

IP4

CUSTOMER_ID 3000 and above

Global Prefixed Index

The index is partitioned independently from the table.

Each index partition can contain entries pointing to rows in multiple table partitions.

Notice the difference:

  • Table is divided based on ORDER_DATE.
  • Global index is divided based on CUSTOMER_ID.
  • The first index column matches the index partition key.
Important:

A Global Prefixed Index does not need to use the table partition key as its leading column. It must use its own index partition key as the leading column.

4. Example Query

Suppose we execute the following query:

SELECT *
FROM orders
WHERE customer_id = 1500;

What Happens Internally?

  1. Oracle checks the global index partition boundaries.
  2. It identifies IP2 because CUSTOMER_ID 1500 falls between 1000 and 2000.
  3. It searches the relevant global index partition.
  4. The index provides row locations (ROWIDs).
  5. Oracle accesses the corresponding table partitions to retrieve the records.

This can help when searching for customers across multiple monthly table partitions.

Performance Note:

A global prefixed index can support efficient index partition pruning when the query contains suitable predicates on the index partition key.

The optimizer decides whether this index is the most efficient access path.

5. What Is a Global Non-Prefixed Index?

Let's change the index column order.

CREATE INDEX idx_orders_global_np
ON orders (order_id, customer_id)
GLOBAL PARTITION BY RANGE (customer_id)
(
    PARTITION ip1 VALUES LESS THAN (1000),
    PARTITION ip2 VALUES LESS THAN (2000),
    PARTITION ip3 VALUES LESS THAN (3000),
    PARTITION ip4 VALUES LESS THAN (MAXVALUE)
);

Here:

  • Index partition key = CUSTOMER_ID.
  • First index column = ORDER_ID.
  • The first index column does not match the index partition key.

Therefore, this is a Global Non-Prefixed Index.

Index Partition Key = CUSTOMER_ID

First Index Column = ORDER_ID

GLOBAL NON-PREFIXED INDEX

6. Global Prefixed vs Global Non-Prefixed

This is an important Oracle interview comparison.

Feature Global Prefixed Global Non-Prefixed
Index partition key First index column Not the first index column
Global index Yes Yes
Partitioning structure Independent of table Independent of table
Index partition pruning Supported when query filters on index partition key May require scanning multiple index partitions
Main difference Column order matches Column order does not match

7. Local Prefixed vs Global Prefixed

This is particularly important for Oracle interviews.

Feature Local Prefixed Global Prefixed
Index partitioning Follows table partitioning Independent of table
Leading column Table partition key Index partition key
Partition key Same as table's partition key Can differ from table's partition key
Number of index partitions Corresponds to table partitions Independently defined
Maintenance Generally easier May require additional maintenance
Interview Tip:

For a local prefixed index, compare the leading index column with the table partition key.

For a global prefixed index, compare the leading index column with the global index partition key.

8. How to Identify a Global Prefixed Index?

Check the index partitioning information:

SELECT
    INDEX_NAME,
    TABLE_NAME,
    LOCALITY,
    ALIGNMENT
FROM USER_PART_INDEXES
WHERE TABLE_NAME = 'ORDERS';

Check the index columns:

SELECT
    INDEX_NAME,
    COLUMN_NAME,
    COLUMN_POSITION
FROM USER_IND_COLUMNS
WHERE TABLE_NAME = 'ORDERS'
ORDER BY INDEX_NAME, COLUMN_POSITION;

Compare the first index column with the index partition key to determine whether the global index is prefixed.

Remember:

USER_PART_INDEXES provides index locality and alignment information.

USER_IND_COLUMNS provides index column order.

For the exact partition key definition, examine USER_IND_PARTITIONS and the index DDL using DBMS_METADATA.GET_DDL where appropriate.

9. Interview-Ready Answer

Interviewer Question:

What is a Global Prefixed Index in Oracle?

Answer:

"A Global Prefixed Index is a global partitioned index in which the leading column of the index matches the index partitioning key.

For example, if an ORDERS table is partitioned by ORDER_DATE, we can create a global range-partitioned index on CUSTOMER_ID and ORDER_ID, with CUSTOMER_ID as the index partition key.

Since CUSTOMER_ID is also the first index column, it is a Global Prefixed Index.

Unlike a local index, its partitioning structure is independent of the underlying table's partitioning structure."

10. Test Your Understanding

Interview Question

Your global index is partitioned by CUSTOMER_ID.

Which index definition is a Global Prefixed Index?

Conclusion

Final Summary

A Global Prefixed Index in Oracle is a global partitioned index in which the first index column matches the index partition key.

  • The index has its own independent partitioning structure.
  • The index partition key can differ from the table partition key.
  • The first index column must match the global index partition key.
  • It can support index partition pruning when queries filter on the index partition key.
  • It is useful for queries accessing data across multiple table partitions.
GLOBAL PREFIXED INDEX
= First Index Column Matches Index Partition Key
Next Topic:

Global Non-Prefixed Index in Oracle with Practical Example.

What is a local non-prefixed index

A LOCAL NON-PREFIXED INDEX in Oracle is a local partitioned index in which the partition key of the table is NOT the first column in the index definition.

In simple words:

If the table's partition key is not the leading (first) column of the local index, it is called a Local Non-Prefixed Index.

Let's understand with a practical example.

1. Create a Partitioned Table

Suppose we have an ORDERS table partitioned by ORDER_DATE.

Creating the Table

CREATE TABLE orders (
    order_id NUMBER,
    order_date DATE,
    customer_id NUMBER,
    amount NUMBER
)
PARTITION BY RANGE (order_date)
(
    PARTITION p_jan
    VALUES LESS THAN (DATE '2025-02-01'),

    PARTITION p_feb
    VALUES LESS THAN (DATE '2025-03-01'),

    PARTITION p_mar
    VALUES LESS THAN (DATE '2025-04-01'),

    PARTITION p_apr
    VALUES LESS THAN (DATE '2025-05-01')
);

Here:

  • Table partition key = ORDER_DATE
  • Partitioning method = RANGE
  • Number of partitions = 4
Remember:

Table partition key = ORDER_DATE

Partitioning method = RANGE

Number of partitions = 4

2. Create a Local Non-Prefixed Index

Now create an index with CUSTOMER_ID as the first column and ORDER_DATE as the second column.

CREATE INDEX idx_orders_customer
ON orders (customer_id, order_date)
LOCAL;

Why Is This a Local Non-Prefixed Index?

Because:

  • Table partition key = ORDER_DATE
  • First index column = CUSTOMER_ID
  • Partition key is the second index column.
Table Partition Key = ORDER_DATE

First Index Column = CUSTOMER_ID

Therefore, it is a Local Non-Prefixed Index.

Local Non-Prefixed Index Structure

ORDERS TABLE

Partition Key: ORDER_DATE

Table partitioning column

LOCAL INDEX

CUSTOMER_ID

First column

ORDER_DATE

Second column - Partition key

Index Column Sequence:
(CUSTOMER_ID, ORDER_DATE)
Local Non-Prefixed Index

Oracle creates corresponding index partitions for the four table partitions.

Each local index partition contains entries for rows in its corresponding table partition.

3. How Does a Local Non-Prefixed Index Work?

Suppose we execute this query:

SELECT *
FROM orders
WHERE customer_id = 1001;

What Happens Internally?

  1. Oracle checks the local index partitions.
  2. Since CUSTOMER_ID is the leading index column, Oracle can use that column to search within each relevant local index partition.
  3. Because the query does not specify ORDER_DATE, Oracle generally needs to consider all table partitions.
  4. Oracle retrieves matching rows from the corresponding table partitions.

This is useful when customers have orders across multiple months.

Important:

A local non-prefixed index does not automatically mean that Oracle must scan every index partition in every query.

Partition pruning is still possible when the query contains suitable partition-key predicates.

4. Another Example: Query Using Both Columns

Now consider a query that uses both CUSTOMER_ID and ORDER_DATE.

SELECT *
FROM orders
WHERE customer_id = 1001
AND order_date >= DATE '2025-02-01'
AND order_date < DATE '2025-03-01';

What Happens Internally?

  1. Oracle identifies the February partition using ORDER_DATE.
  2. Other partitions can be eliminated through partition pruning.
  3. Oracle searches the corresponding local index partition using CUSTOMER_ID and ORDER_DATE.

This can reduce unnecessary index and table access.

Performance Note:

Because the index contains both columns, Oracle can use the leading column and the following column to access matching entries within the selected index partition.

5. Local Prefixed vs Local Non-Prefixed Index

This is a very important Oracle interview question.

Feature Local Prefixed Local Non-Prefixed
First index column Partition key Not partition key
Index partitioning Local Local
Partition pruning Supported Supported
Query by partition key Can be useful Can also be useful
Query by other indexed columns Depends on index order Often useful if those columns lead the index

Compare the SQL Statements

Suppose the table partition key is ORDER_DATE.

Local Prefixed Index:
CREATE INDEX idx1
ON orders (order_date, customer_id)
LOCAL;
Local Non-Prefixed Index:
CREATE INDEX idx2
ON orders (customer_id, order_date)
LOCAL;
The Difference Is Simply the Order of the Index Columns
Important Interview Point:

Partition pruning is primarily determined by query predicates on the table's partition key, not simply by whether the index is prefixed or non-prefixed.

6. Real-Time Example: Banking Application

Imagine a banking application with 500 million transaction records.

Table Partitioning:

PARTITION BY RANGE (transaction_date)

Most application queries search using CUSTOMER_ID.

For example:

SELECT *
FROM transactions
WHERE customer_id = 1001;

A Local Non-Prefixed Index could be:

CREATE INDEX idx_trans_customer
ON transactions (customer_id, transaction_date)
LOCAL;

Why Use This Index?

  • Customers can have transactions across multiple months.
  • CUSTOMER_ID is the leading index column.
  • Each monthly partition has its own local index partition.
  • Oracle can search the relevant index partitions for that customer.
Real-Time Performance Note:

A local non-prefixed index may be useful when customer-based searches are common.

Whether this is better than a global index depends on workload, data distribution, partition count, and performance testing.

7. How to Identify Local Non-Prefixed Indexes?

You can check the index locality:

SELECT
    INDEX_NAME,
    TABLE_NAME,
    LOCALITY
FROM USER_PART_INDEXES
WHERE TABLE_NAME = 'ORDERS';

To check the index columns and their order:

SELECT
    INDEX_NAME,
    COLUMN_NAME,
    COLUMN_POSITION
FROM USER_IND_COLUMNS
WHERE TABLE_NAME = 'ORDERS'
ORDER BY INDEX_NAME, COLUMN_POSITION;

You need to compare the first index column with the table's partition key to identify whether the local index is prefixed or non-prefixed.

Remember:

USER_PART_INDEXES identifies index locality, while USER_IND_COLUMNS helps identify the index column order.

8. Interview-Ready Answer

Interviewer Question:

What is a Local Non-Prefixed Index in Oracle?

Answer:

"A Local Non-Prefixed Index is a local partitioned index in which the partition key of the underlying table is not the leading column of the index.

For example, if an ORDERS table is partitioned by ORDER_DATE, an index on (CUSTOMER_ID, ORDER_DATE) is a local non-prefixed index.

It is useful when application queries frequently search using CUSTOMER_ID, even when data is spread across multiple table partitions."

9. Test Your Understanding

Interview Question

Your Oracle table is partitioned by TRANSACTION_DATE.

Which index is a Local Non-Prefixed Index?

Conclusion

Final Summary

A Local Non-Prefixed Index in Oracle is a local partitioned index in which the table partition key is not the first column in the index definition.

  • The partition key is not the leading index column.
  • The index follows the table partitioning structure.
  • Oracle creates corresponding local index partitions.
  • It can be useful when application queries frequently search using other indexed columns.
  • Partition pruning is still possible when suitable partition-key predicates are present.
  • Index column order should be selected based on actual query requirements.
LOCAL NON-PREFIXED INDEX
= Partition Key Is Not the First Index Column
Next Topic:

When Should We Use Local Prefixed vs Local Non-Prefixed Indexes in Oracle?

What is a local prefixed index

A LOCAL PREFIXED INDEX in Oracle is a local partitioned index in which the leftmost column of the index is the same as the partition key of the table.

In simple words:

The partition key column must be the first column in the index definition.

Let's understand with a practical example.

1. Create a Partitioned Table

Suppose we have an ORDERS table partitioned using ORDER_DATE.

Creating the Table

CREATE TABLE orders (
    order_id NUMBER,
    order_date DATE,
    customer_id NUMBER,
    amount NUMBER
)
PARTITION BY RANGE (order_date)
(
    PARTITION p_jan
    VALUES LESS THAN (DATE '2025-02-01'),

    PARTITION p_feb
    VALUES LESS THAN (DATE '2025-03-01'),

    PARTITION p_mar
    VALUES LESS THAN (DATE '2025-04-01'),

    PARTITION p_apr
    VALUES LESS THAN (DATE '2025-05-01')
);

Here:

  • Table partition key = ORDER_DATE
  • Partitioning method = RANGE
  • Number of table partitions = 4
Remember:

Table partition key = ORDER_DATE

Partitioning method = RANGE

Number of partitions = 4

2. Create a Local Prefixed Index

Now create an index on ORDER_DATE and CUSTOMER_ID.

CREATE INDEX idx_orders_prefixed
ON orders (order_date, customer_id)
LOCAL;

Why Is This a Local Prefixed Index?

Because:

  • Table partition key = ORDER_DATE
  • First index column = ORDER_DATE
Table Partition Key = First Index Column

ORDER_DATE = ORDER_DATE

Local Prefixed Index Structure

ORDERS TABLE

P_JAN

Table partition

P_FEB

Table partition

P_MAR

Table partition

P_APR

Table partition

LOCAL INDEX

ORDER_DATE

First column

CUSTOMER_ID

Second column

Index column sequence: (ORDER_DATE, CUSTOMER_ID)

Local Prefixed Index

Oracle creates corresponding index partitions for each table partition.

Each index partition contains entries for its corresponding table partition.

3. What Is the Purpose of a Local Prefixed Index?

Suppose we execute this query:

SELECT *
FROM orders
WHERE order_date = DATE '2025-02-15'
AND customer_id = 1001;

What Happens Internally?

  1. Oracle checks the ORDER_DATE partition key.
  2. It identifies the February partition.
  3. It eliminates unnecessary partitions using partition pruning.
  4. It can use the corresponding local index partition to find the matching customer record.

This can improve query performance.

Performance Note:

Partition pruning helps Oracle eliminate unnecessary table partitions. The local index can then provide an efficient access path within the relevant partition.

4. What Is NOT a Local Prefixed Index?

Consider this index:

CREATE INDEX idx_orders_nonprefixed
ON orders (customer_id, order_date)
LOCAL;

Here:

  • Table partition key = ORDER_DATE
  • First index column = CUSTOMER_ID
  • The partition key is not the first column.

Therefore, this is a Local Non-Prefixed Index, not a Local Prefixed Index.

Compare Both

Index Definition Index Type
(ORDER_DATE, CUSTOMER_ID) Local Prefixed
(CUSTOMER_ID, ORDER_DATE) Local Non-Prefixed
(ORDER_DATE) Local Prefixed
(CUSTOMER_ID) Local Non-Prefixed
Important:

The position of the partition key in the index definition determines whether a local index is prefixed or non-prefixed.

5. Local Prefixed vs Local Non-Prefixed Index

Feature Local Prefixed Local Non-Prefixed
First index column Partition key Not partition key
Local index Yes Yes
Partition pruning Supported Supported
Useful for date-based queries Yes Depends on query
Partition key in index First position Can be later or absent
Important Interview Point:

Partition pruning is primarily determined by the query predicates on the table's partition key, not simply by whether the index is prefixed.

6. Real-Time Example: Banking Application

Imagine a banking transaction table.

  • Table partition key = TRANSACTION_DATE
  • Frequently searched columns = TRANSACTION_DATE, CUSTOMER_ID

If your queries commonly look like this:

SELECT *
FROM transactions
WHERE transaction_date = DATE '2025-02-15'
AND customer_id = 1001;

A local prefixed index is a suitable candidate:

CREATE INDEX idx_trans_date_customer
ON transactions (transaction_date, customer_id)
LOCAL;

But if your application frequently searches using only CUSTOMER_ID, an index starting with CUSTOMER_ID may be more appropriate:

CREATE INDEX idx_trans_customer_date
ON transactions (customer_id, transaction_date)
LOCAL;

This is a local non-prefixed index.

Real-Time Performance Note:

The best choice depends on actual query patterns, data distribution, index selectivity, and execution plans.

7. Interview-Ready Answer

Interviewer Question:

What is a Local Prefixed Index in Oracle?

Answer:

"A local prefixed index is a local partitioned index in which the partition key of the table is the leading column of the index.

For example, if an ORDERS table is partitioned by ORDER_DATE, an index on (ORDER_DATE, CUSTOMER_ID) is a local prefixed index.

It maintains the local partition structure and can support efficient access when queries filter using the partition key."

8. Test Your Understanding

Interview Question

Your Oracle table is partitioned by EMPLOYEE_DATE.

Which of the following is a Local Prefixed Index?

Conclusion

Final Summary

A Local Prefixed Index in Oracle is a local partitioned index in which the table partition key is the first column in the index definition.

  • The partition key must be the leading index column.
  • The index follows the table partitioning structure.
  • Oracle creates corresponding local index partitions.
  • It can be useful for queries filtering on the partition key and other indexed columns.
  • Index column order should be selected based on actual query requirements.
LOCAL PREFIXED INDEX
= Partition Key as First Index Column
Next Topic:

Local Non-Prefixed Index in Oracle with Example.

Difference Between Local and Global Indexes in Oracle

In Oracle, Local and Global indexes are two types of indexes used on partitioned tables.

The main difference is:

  • Local Index: Index partitioning follows the table partitioning structure.
  • Global Index: Index partitioning is independent of the table partitioning structure, or the index can be nonpartitioned.

Let's understand both indexes with practical examples and diagrams.

1. First, Create a Partitioned Table

Suppose we have an ORDERS table containing millions of records.

We partition the table based on ORDER_DATE.

Creating the Table

CREATE TABLE orders (
    order_id NUMBER,
    order_date DATE,
    customer_id NUMBER,
    amount NUMBER
)
PARTITION BY RANGE (order_date)
(
    PARTITION p_jan
    VALUES LESS THAN (DATE '2025-02-01'),

    PARTITION p_feb
    VALUES LESS THAN (DATE '2025-03-01'),

    PARTITION p_mar
    VALUES LESS THAN (DATE '2025-04-01'),

    PARTITION p_apr
    VALUES LESS THAN (DATE '2025-05-01')
);

Our table has four partitions:

  • P_JAN
  • P_FEB
  • P_MAR
  • P_APR
Remember:

Table partition key = ORDER_DATE

Table partitioning method = RANGE

2. Local Index Example

Suppose we frequently search orders using CUSTOMER_ID.

Create a local index:

CREATE INDEX idx_orders_local
ON orders (customer_id)
LOCAL;

What Happens Internally?

Oracle creates four corresponding index partitions because our table contains four partitions.

Local Index Structure

Table partitions and index partitions follow the same structure.

P_JAN - Table Partition

↓

IDX P_JAN - Index Partition
P_FEB - Table Partition

↓

IDX P_FEB - Index Partition
P_MAR - Table Partition

↓

IDX P_MAR - Index Partition
P_APR - Table Partition

↓

IDX P_APR - Index Partition
One-to-One Correspondence

Each local index partition contains index entries for rows in its corresponding table partition.

Important:

Local indexes do not necessarily need to use the table's partition key as their index column.

Here, the index is on CUSTOMER_ID, while the table is partitioned by ORDER_DATE.

3. Global Index Example

Now create a global partitioned index on CUSTOMER_ID.

CREATE INDEX idx_orders_global
ON orders (customer_id)
GLOBAL PARTITION BY HASH (customer_id)
(
    PARTITION idx_p1,
    PARTITION idx_p2,
    PARTITION idx_p3,
    PARTITION idx_p4
);

Here:

  • Table partition key = ORDER_DATE
  • Global index partition key = CUSTOMER_ID
  • Table partitioning method = RANGE
  • Index partitioning method = HASH

See the Structure

Global Partitioned Index Structure

ORDERS Table

P_JAN

Range partition

P_FEB

Range partition

P_MAR

Range partition

P_APR

Range partition

GLOBAL INDEX

IDX_P1

Hash partition

IDX_P2

Hash partition

IDX_P3

Hash partition

IDX_P4

Hash partition

Independent Partition Structures

A global index partition can contain entries pointing to rows in multiple table partitions.

Unlike local indexes, there is no one-to-one relationship between table and index partitions.

Important Difference:

Local indexes follow the table partitioning structure. Global partitioned indexes have their own independent partitioning structure.

4. Global Nonpartitioned Index Example

There is another important type of global index.

A global nonpartitioned index is one index covering the entire partitioned table without dividing the index into partitions.

CREATE INDEX idx_orders_global_nonpart
ON orders (customer_id);

Notice that we didn't specify LOCAL or GLOBAL PARTITION BY.

Because the underlying table is partitioned, this creates a global nonpartitioned index.

5. Main Differences Between Local and Global Indexes

Feature Local Index Global Index
Partition structure Follows table Independent or nonpartitioned
Partition relationship Corresponding partitions No one-to-one relationship
Index partition key Follows table partitioning Can be different
Partition maintenance Generally easier May need additional maintenance
Partition drop Corresponding local index partition is handled Global index may become unusable without maintenance
Best suited for Partition-level operations Queries across multiple table partitions

6. Real-Time Example: Banking Application

Imagine a banking application with 500 million transaction records.

The table is partitioned monthly using TRANSACTION_DATE.

PARTITION BY RANGE (transaction_date)

Now consider two queries.

Query 1: Search Transactions for February

SELECT *
FROM transactions
WHERE transaction_date >= DATE '2025-02-01'
AND transaction_date < DATE '2025-03-01';

A local index can be useful because Oracle can prune the table to February and access the corresponding local index partition if appropriate.

Query 2: Search a Customer's Transactions Across All Months

SELECT *
FROM transactions
WHERE customer_id = 1001;

A global index on CUSTOMER_ID may be useful because it can locate matching entries across different table partitions.

Performance Note:

The optimizer chooses the access path based on estimated cost.

A global index is not automatically faster than a local index for cross-partition queries.

7. What Happens When We Drop a Partition?

This is a very important Oracle DBA interview question.

Suppose we execute:

ALTER TABLE orders
DROP PARTITION p_jan;

With Local Index

  • The corresponding local index partition is automatically removed along with the table partition.
  • Other local index partitions remain available.

With Global Index

  • The global index may become unusable if you don't maintain it.
  • You can maintain it using UPDATE GLOBAL INDEXES.
ALTER TABLE orders
DROP PARTITION p_jan
UPDATE GLOBAL INDEXES;

This maintains the global indexes during the partition drop operation.

Interview Tip:

Using UPDATE GLOBAL INDEXES maintains global indexes during supported partition maintenance operations instead of leaving them unusable.

8. How to Identify Local and Global Indexes?

Run this query:

SELECT
    INDEX_NAME,
    TABLE_NAME,
    LOCALITY
FROM USER_PART_INDEXES
WHERE TABLE_NAME = 'ORDERS';

For a more complete view, check both partitioned and nonpartitioned indexes:

SELECT
    INDEX_NAME,
    TABLE_NAME,
    PARTITIONED
FROM USER_INDEXES
WHERE TABLE_NAME = 'ORDERS';

Interpretation:

  • LOCALITY = LOCAL: Local partitioned index.
  • LOCALITY = GLOBAL: Global partitioned index.
  • PARTITIONED = NO: Nonpartitioned index, which is global if its table is partitioned.

9. Interview-Ready Answer

Interviewer Question:

What is the difference between Local and Global Indexes in Oracle?

Answer:

"A local index follows the partitioning structure of its underlying table. Each table partition has a corresponding local index partition.

A global index has an independent partitioning structure or can be nonpartitioned.

Local indexes are easier to maintain during partition-level operations, whereas global indexes are useful for queries that search across multiple table partitions.

Global indexes may require additional maintenance when table partitions are dropped or truncated."

10. Test Your Understanding

Interview Question

Your ORDERS table has 12 monthly partitions. You create a local index on CUSTOMER_ID.

How many corresponding index partitions will Oracle create?

Conclusion

Final Summary

Local and Global indexes are both important in Oracle partitioned tables.

  • Local indexes follow the partitioning structure of the underlying table.
  • Global partitioned indexes have an independent partitioning structure.
  • Global nonpartitioned indexes cover the entire partitioned table without separate index partitions.
  • Local indexes are generally easier to maintain during partition-level operations.
  • Global indexes may require additional maintenance when table partitions are dropped or truncated.
LOCAL = Follows Table Partitioning

GLOBAL = Independent or Nonpartitioned
Next Topic:

Local Prefixed vs Local Non-Prefixed Indexes in Oracle.