• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Partitioned index for primary key on partitioned table

Resolved: Partitioned index for primary key on partitioned table

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I want to create partitioned table:
And there will be about 300 millions row. I can’t find clear answer about partitioning of PK for partitioned table.
My questions are:
  1. Should I make a partitioned index for primary key?
  2. It must be globally partitioned or local?
  3. It must be hash partitioned?
  4. How to know how many partitions must be for that index?

It should be something like this:
or not?)
What is best practice with pk of partitoned table?

Answer:

You can create UNIQUE (or PRIMARY KEY) index LOCAL however, then the partition key must be part of the index, i.e. you need to create a composite primary key:
A UNIQUE LOCAL index is not possible, unless partition key column is included.
An index like
is possible. However the index partitions will be different to the table partitions. I don’t see any purpose of this index. You don’t gain any performance by Partition Pruning and when you drop/truncate a partition then you have to rebuild index audit_unq. So you don’t get any benefit, actually it combines the drawbacks of global and local indexes.

If you have better answer, please add a comment about this, thank you!

oracle partitioning
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Why doesn’t stringstream consume output during hex formatting?

24/03/2023

Resolved: CMake path for python3 libraries doesn’t change (windows 10)

24/03/2023

Resolved: GLMM with quasi-Poisson distribution

24/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.