On Monday, April 4, 2011 11:56:03 AM UTC-4, Laird Nelson wrote:
>
> I'm going through the H2 source code for FunctionTable.java, and the first 
> thing that I have a detailed question about is: is there some way to have 
> H2's query optimizer supply me with an appropriate WHERE clause when such a 
> clause can be determined to be constant?
>

Or, even more specifically: when H2 is asking my table function for its 
results, it would be great if my table function could be supplied with a 
list of TableFilters or some other mechanism of telling me exactly what 
subset of columns I actually have to return values for.

Presumably by the time my table function is called "for real" (i.e. not just 
to get the column names), H2 knows that, for example, the query is only 
going to use, say, a couple of columns from those which my table function is 
capable of returning.  It would be nice to know what those columns are.

I can fake this by doing some egregious hacking: if my first parameter to my 
table function is a JdbcConnection, then I have access to the current 
Session, and from that I can get the current Command.  However, the Command 
that is passed in here is actually a CommandContainer, and wraps the 
Prepared that would otherwise give me the information I need.

I hope this "discussion" proves interesting to at least one other party :-)

Best,
Laird 

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to