db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rami Ojares <rami.oja...@pdf-comics.com>
Subject Table functions and optimization
Date Sat, 20 Mar 2010 16:26:00 GMT
Hi,

I have a table function that queries 2 tables and calculates some 
columns from them.
All is going well.

But when I start creating larger queries using that calculated table I 
find it very hard to tell derby
that please invoke that table function only once per query.

First does a table function have some kind of rowcount because rowcount 
is used by derby to decide how cheap it is to keep querying a table 
again and again.
Best would be some kind of way in function definition to tell derby that 
invoke this table function only once per query and use the same result 
you received over and over again.

Currently I cache the last results of the table function for 3 seconds 
which is obviously not optimal.

- rami

Mime
View raw message