Details
Description
I used the FilterableTable mode in the project, but I found that the query was particularly slow. I used the JProfile tool to troubleshoot the thread time-consuming place, and then through the debug, I found that each request took two places:
1、org.apache.calcite.adapter.enumerable.EnumerableInterpretable#getBindable
This place optimizes the cache settings by setting the cache size.
2、org.apache.calcite.interpreter.JaninoRexCompiler#baz
But this place is not cached, and a new expression string is used every time to create it through reflection.
JProfile tool time consumption:
I originally wanted to add a layer of cache here, but found that the expressions generated each time are different, as follows:
So you can't use the getBindable method to directly add cache.
Is there anything you can optimize here? For example, can you generate a template class in advance, and then generate different objects through different parameter values?
Bring tea to the boss!
Looking forward to your reply!
Attachments
Attachments
Issue Links
- is related to
-
CALCITE-2703 Reduce code generation and class loading overhead when executing queries in the EnumerableConvention
- Closed