|Subject||Re: [ib-support] generator question|
|Author||Ann W. Harrison|
>Sindu wrote,At 10:25 AM 3/20/2001 +0100, Nando Dessena wrote:
> > Anyway I'm just curious where the *IB Server* store the last value of the
> > generator. I guess your tips means it doesn't expose it to any system
> > tables then (like the way Oracle does in USER_SEQUENCES view).
>each database has one (or more?) generator page(s), in which a generatorThat is exactly right. The number in RDB$GENERATORS is the offset of the
>value is looked up using the generator id as a sort of array index, I
generator. The database know how many generators fit on a page, so the
divide operation give the page sequence number and the modulo the offset
on page. The RDB$GENERATORS record is approximately four times the size
of the actual generator, so deleting it reclaims most of the space. Not
that anyone should be worrying about the odd 50 bytes in a table that
never has more than 10,000 rows... [If your application uses more than
10.000 generators, please don't tell me about it.]
I doodled for a minute with creating a USER_SEQUENCES view but think
it could not be done without a UDF - and a messy UDF at that.
We have answers.