This week's book giveaway is in the Cloud/Virtualization forum.We're giving away four copies of Grokking Bitcoin and have Kalle Rosenbaum on-line!See this thread for details.
Win a copy of Grokking Bitcoin this week in the Cloud/Virtualization forum!
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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Liutauras Vilda
• Bear Bibeault
• Tim Cooke
• Junilu Lacar
Sheriffs:
• Paul Clapham
• Devaka Cooray
• Knute Snortum
Saloon Keepers:
• Ron McLeod
• Tim Moores
• Stephan van Hulst
• Tim Holloway
• Frits Walraven
Bartenders:
• Carey Brown
• salvin francis
• Claude Moore

# any alternative to using sequence numbers?

Greenhorn
Posts: 28
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: 17344
11
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

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.