Good to know. I'm not worried about performance that much. I'm sure I can optimize the query(s) once I get them all figured out. What would have made the ability to store functions nice is that there are many that are reused in different queries, so currently I have to have multiple copies. Then if I make a change, I have to remember to make it to all of them. Not a big deal, just a matter of efficiency. But I can work around this on my end by storing the functions in one spot and then just inserting them programatically as necessary into the query.
When I get to optimizing, I will gladly take advantage of your offer. Huib has already given me some good ideas.
Chas.
On 12/29/2010 7:08 AM, Michael Seiferle wrote:
Hi Chas, (and hi Huib),
thanks for your input!
At the moment preloading& compiling queries ahead of time is not possible. The main reason for this is that, from our experience, queries are usually rather short and cheap to compile.
Providing an infrastructure that takes care of precompiled queries might present quite a challenge, yet it should not be impossible.
You two probably knew this, but it might be of interest to the list as well, there's a very basic benchmark mechanism:
SET RUNS N
Now every query you issue is run N-times, including parsing& compiling. You will get average duration values for each step, if you enable the query info view.
This is not representative, but on my machine the 40KB functx library [1] takes an avg of ~13ms to parse and ~7ms to compile, so the overhead introduced by reparsing/recompiling should be rather low in general.
In case you experience particular problems with specific queries feel free to contact us. Often tweaking the query a little, such that possible index optimizations are recognized correctly by our compiler will speed up queries considerably.
I hope this helps, feel free to ask for more! Feedback is very welcome :-)
Kind regards Michael
Am 29.12.2010 um 07:40 schrieb Charles F. Munat:
The other question I had was if it was possible to pre-load the embedded database with the functions, rather than having to load them all at the time the xquery is run. Sort of the way functions or triggers are preloaded into an RDBMS. Do you happen to know if that's possible?