Thread: Re: Sequence Question DOH!

Re: Sequence Question DOH!

From
Oscar Tuscon
Date:
Oscar - if you're still interested in grabbing variable ranges of
sequence-id's then I had an idea. Just multiply nextval() by 1000 (or
whatever) and use however many you need. You'll want to set the maximum
for the sequence correspondingly lower.
--
   Richard Huxton
   Archonet Ltd

Thanks Richard,
I'd considered using an approach as you suggest, but I need long term high volume scalability and don't want to waste
sequencevalues. Not that 2**64 will happen anytime soon... 

What I did was to use my existing shm subsystem, which controls accesses with semaphores, and allocated a lock obj. I
justmodified my sequence accessor (which was already abstracted to keep db independence) to lock/unlock around sequence
nextval/setval.Since the majority of my sequence requirements are for batches I wound up with about a 30% net app
performanceimprovement (and about 500x in the sequence accessing!) 

Oscar


_____________________________________________________________
The BMW E30 community on the web---> http://www.bmwe30.net