Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: What do you do with an ENORMOUS primary key?
On Fri, 21 Jun 2002 06:25:29 +1000, "Howard J. Rogers"
<dba_at_hjrdba.com> wrote:
>So real dates and hence date ranges are out of the question, I'm afraid. But
>I appreciate your thoughts nonetheless.
...
>> > Create table STANDARDS (
>> > asstcode varchar2(3),
>> > jobcode number(5,0),
>> > season varchar2(3),
>> > period number (2,0),
>> > week number (2,0),
>> > day varchar2(3))
...
>> > My trouble is that since an assett can have many jobs scheduled for it,
>> and
>> > each job can be scheduled many times, the entire table is the entire
>> primary
>> > key.... and that doesn't feel right to me.
How about hashing all these values into a single integer value, then using that as the primary key?
You'd just have to concatenate everything into a single string in your trigger or stored function. Don't know to what degree this *guarantees* uniqueness, if the calls are done over multiple sessions.
John
-- Got an Oracle database question? Try the search engine for the database docs at: http://tahiti.oracle.com/ The opinions expressed above are mine and do not necessarily reflect those of Oracle Corporation.Received on Sat Jun 22 2002 - 13:13:35 CDT