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.