What should be my PK?
Posted by: Ahmad Sakhi
Date: May 18, 2016 07:39AM

Hello everyone,

I have a large amount of data (~9 Billion) to load in one table. The table is primarily used for SELECT to query data. There will not (or very rarely) be INSERT, UPDATE or DELETE.

I have identified the following 3 crucial fields.

- Field#1 --> This field will be used in my WHERE clause of the SELECT statement to retrieve some 5 to 1000 rows. This field is NOT unique.
- Field#2 --\
             ---> Combination of these 2 fields identifies a unique record, so good candidate for PK.
- Field#3 --/

So, I am planning to have:

PK(Field#2, Field#3)
INDEX(Field#1)

My question is:

- Should I make Field#1 as part of my PK? Would that help my query faster?
- Or what I have in mind to INDEX Field#1, and make Field#2, Field#3 my PK?

Thanks.

Options: ReplyQuote


Subject
Written By
Posted
What should be my PK?
May 18, 2016 07:39AM
May 18, 2016 09:42AM
May 18, 2016 09:50AM
May 23, 2016 04:13PM
June 04, 2016 08:53PM
June 05, 2016 11:40AM
June 07, 2016 03:52PM
June 08, 2016 08:10AM
June 08, 2016 09:03PM
June 09, 2016 07:55AM
June 13, 2016 01:51AM
June 16, 2016 09:38AM
June 20, 2016 12:45AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.