Subject Re: [ib-support] Re: Database grows rapidly (3 to 770MB) when using BLOB views/UDFs
Author Claudio Valderrama C.
""Ivan Prenosil"" <prenosil@...> wrote in message
news:20020322115314.8B2771502C@......
> >
> > This only depends on how smart is the DSQL layer. Probably it does its
own
> > protection, I haven't checked (transforming A into B). But in the
general
> > case, rest assured that both notations DO NOT produce the same effect
(and
> > they aren't designed to produce the same effect, of course).
>
> Both DECLARE statements will create identical entries in
> rdb$functions and rdb$function_arguments tables.
> (the only difference is that arguments are _physically_ stored
> in different order). How can they produce different effects ?

Don't ask me. Take time, go to JRD and load FUN.E, then read the full
contents of
FUN_evaluate
Once you have assimilated it, we can continue. Pay attention to the places
where it says:

if (tail == return_ptr)
<something>;

One practical example is that fbudf's getExactTimestamp doesn't work with IB
but does work with FB. Why? Because one of those cases with special param
position wasn't implemented (the timestamp case).


> Are there more system tables involved ?

No. UDFs only use two system tables. I'm leaving blob filters apart.


> If I backup/restore database with these declarations,
> (to eliminate a possibility that some informations are held in memory)
> how can the engine tell what kind of declaration was used ?

Obviously, by using the relative position of the arguments that's changed
between one declaration and the other. You answered your own question. :-)
Using the "returns parameter N" syntax was meant to force the engine to
provide the space [of a fixed length] for the return argument instead of
having the UDF allocating it and using FREE_IT, for example.

C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing