Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: primary key, local partition index - prefixed/non-prefixed
Sean,
Don't forget that partitioning means scattering rows at different physical locations depending on some criterion. Fancy a moment you are Oracle and you get a query with the sole criterion
where id = some_value
To which index partition do you want to go to find your rowid? Assuming that your index is partitioned, you would have to search all partitions in turn (or in parallel) until you hit the good value (all of them before returning 'no data found'). Hardly ideal. Can you imagine the work involved when inserting a row into a table referencing this one? And with unique indexes it makes checking duplicates a nightmare (you would have to search as many trees as partitions) which is why Oracle forbids it - unless the partitioning key is part of the index keys and therefore we are certain we cannot possibly find a duplicate in another partition.
In your case your PK should therefore be global. On pure performance grounds (as opposed to maintenance ones) the benefits of partitioning are :
a) Partition pruning, which means that the partition key must be involved somewhere in your criteria
b) Parallelism
If you are not on a massively parallel box, my feeling is, once again forgetting about maintenance considerations, you are better off with global indexes rather than artificially local ones if your partition key is no 'natural' part of your index.
Regards,
Stephane Faroult
Oriole
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stephane Faroul INET: sfaroult_at_oriolecorp.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Fri Jan 10 2003 - 03:09:56 CST
![]() |
![]() |