Subject | Re: [firebird-support] Re: Hundreds of Generators |
---|---|
Author | Ann W. Harrison |
Post date | 2010-04-29T15:11:35Z |
zvjezdantomicevic wrote:
and it would produce deadlocks if two people tried to create identifiers
at once, and even if it were never updated concurrently, the lookup
and update/insert is much more computationally costly than using a
generator.
What problem are you trying to solve?
Cheers,
Ann
> Just from top of my head:The table would take more space than the whole set of generators,
> How about creating table
> ITEM_ID int
> YEAR int
> COUNTER int
> and use triggers.
> If record for that year does not exist,insert it with counter 0,
> and if it does, increase counter by 1 using trigger.
>
> You have if exists, insert or update statements, and before insert/update triggers at your disposal to do this.
>
and it would produce deadlocks if two people tried to create identifiers
at once, and even if it were never updated concurrently, the lookup
and update/insert is much more computationally costly than using a
generator.
What problem are you trying to solve?
Cheers,
Ann