> Can you comment on expected performance degredation now that we are
> caching less, I don't know what work the caching is saving. Since we
> are still caching privately I think only expected degredation is on
> first call for booted db, though I know there are some applications
> out there that boot very often.
That's right, degradation should only be expected on the first call of
a SYSFUN function after the second db boot.
I'm not sure what degradation to expect myself, so I've written a
small test program that executes the following statement repeatedly:
The statement calls seven different SYSFUN functions, and I would
expect it to be very close to the worst case since VALUES statements
are among the cheapest ones to compile.
I also turned off the statement cache, so that each execution of the
statement would cause a compilation (it is during the bind phase of
the compilation the SYSFUN_AD array is accessed).
Using the test program, I compared clean trunk to a variant that was
modified to skip the caching altogether. That is, I commented out the
following line in DataDictionaryImpl.getRoutineList():
DataDictionaryImpl.SYSFUN_AD[f] = ad;
The variant that didn't cache the alias descriptor, executed the
statement 2.5% slower on average in my environment.
Since this degradation will only be observed when SYSFUN functions are
compiled for the first time in newly booted databases, I'd say it's
One might perhaps even say that the gains of the alias descriptor
cache are so small that they don't justify the extra memory and code
complexity, but I don't think we want to go there in this JIRA.
> If there were no memory consequences does the existing
> implementation have any correctness issues?
Not that I have been able to find. The data dictionary instance is
only used in the following situations, as far as I can tell:
- At initialization time of the AliasDescriptor to find the UUID of
the SYSFUN schema. This doesn't cause any problems, since the data
dictionary instance is still alive at that time, and the UUID of the
SYSFUN schema is the same in all databases.
- When an alias is dropped, but the functions in SYSFUN can't be
- During invalidation, but SYSFUN functions can't be invalidated.