Offhand, it's an expensive thing to obtain a connection, query the sequence, and disconnect, all for the sake of a page count.
*on the other hand*... how else are these things done, right?
One thing I noticed about Oracle sequences, which I hadn't realized until I had performed
testing over several days time... If the sequence has a buffer, and it is not queried for some amount of time (which I haven't been able to figure out, or see where it is set)... the sequence looses the buffered numbers.
I used a sequence for 'next primary key' generation.. I was noticing the following.. one day when i did my tests, I'd have 100,101,102,103,etc...
Several hours later it would be 104,105,106,etc...
But on the next day, it would start at 120,121,122,123...
and the next day would be 140,141,142.
The sequence buffered 20 'next numbers'... but if they're not used in time, they're gone!
Now you *could* set it not to buffer any, but does anyone know how to tell Oracle to simply *not* dump its buffer. My books don't show me the magical 'timeout' setting.