• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

any alternative to using sequence numbers?

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

i am using sequence numbers to uniquely identify the rows in a table.
But the numbers of rows that will be inserted daily will be in the order of thousands .. (1000-3000). So it is possible that the sequence nos get used quickly and the prev data will be overrriden (assuming that all the data is required for some time)

Is there any alternative to using sequences??
Also performance wise will there be any problem in using sequences in this case
(I am no goood in DB pls suggest!!)

Thanks
Sunitha
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The sequence tables can go to a very very large number, so even at 100 per day, you shouldn't run out. You can also cache a good number of them at a time, so the performance is better.

The other option is to have the Application determine the next number, in which cas you would have to do a query on the table to determine the highest number already used and add 1 to it.

I prefer the Sequence Table better.

Mark
 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mark Spritzler:
The sequence tables can go to a very very large number,



The maximum Oracle sequence number is 10 ** 27, or
1,000,000,000,000,000,000,000,000,000

If you use 1 billion (American billion, 10**9) a day, you will run out in a billion billion days.

Most people find that adequate.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic