Hi Paul, Have a look also in CALCITE-2703 [1].
Calcite generates and compiles code and this takes some time (which may be more than the time to optimize or even run the query). In CALCITE-2703 we try to reduce that time by caching. Best, Stamatis [1] https://issues.apache.org/jira/browse/CALCITE-2703 Στις Πέμ, 7 Φεβ 2019 στις 12:01 μ.μ., ο/η Enrico Olivelli < eolive...@gmail.com> έγραψε: > Paul, > > Il giorno mer 6 feb 2019, 23:02 Paul Trepagnier <p...@trepagnier.org> ha > scritto: > > > I am using calcite right now to test some data federation scenarios. I > > have several collections of Java objects that I am querying right now. > It > > works beautifully, but it seems like Calcite does a ton of work with each > > query and does not cache any of the work. > > > > Is there a way for me to implement a plan cache within Calcite? Or is > > there already a mechanism for this? > > > > Are you willing to cache Calcite RelNodes directly? > In one of my projects I am not caching them directly but immutable > structures created by visiting RelNodes. > > Enrico > > > > I tested implementing my own subclass of PreparedStatementFactory and > > caching the CalciteSignature for calls to prepareSql. This seems to work > > really well, but I am not sure if 1) this is safe to do and 2) is this > the > > proper way to do it. > > > > Thanks for your help, > > > > Pau; > > >