Subject | Re: [Firebird-Architect] Metadata cache |
---|---|
Author | Alex Peshkov |
Post date | 2008-08-18T06:29:09Z |
On Saturday 16 August 2008 17:55, Dmitry Yemanov wrote:
global counter, request before execution performs single comparison, w/o need
in any locks during it.
> Dimitry Sibiryakov wrote:Yes. One possible (and appears very fast) was already described by Vlad here:
> > But this verification will happen on every DML execution.
>
> I don't think so. I suppose there are many ways to set the flag during
> DDL and then check it during DML.
> 1. Introduce database-global atomic counter of DDL transactions. It may beYou see - minimum overhead on both ends: DDL transaction modifies single
> stored in header page or in shared memory, lets decide later.
>
> 2. Every DDL transaction increments this counter at the very end stage of
> its commit.
>
> 3. Every prepared statement marked by current value of this DDL_TX counter
> at preparation time.
>
> 4. Every statement before every execution compared its private DDL_TX mark
> with current value of global DDL_TX. If private mark is less then global,
> statement must check all used metadata objects for obsolete flag. If such
> object is found, statement marked as obsolete and must be re-prepared (if
> possible) or it will raise error on execution. If such object was not found
> statement marked with new value of DDL_TX and started its execution.
global counter, request before execution performs single comparison, w/o need
in any locks during it.