Looking for help on query optimization statistics
I'm working on comparing the query plan generated by Calcite with that from a DBMS I'm developing.
In particular, I can generate some TPC-H data and a SQL query, and I want to let Calcite generate as good query plan as it can. So far, I haven't passed any statistics to Calcite, so the query plan it generates is just a baseline.
Now I wonder how I could pass statistics to Calcite. What I don't understand is that since Calcite does not load the data until query plan is actually executed, how could I pass statistics to it?
I fail to find any document talking about how to do that in detail. The last paragraphs of http://calcite.apache.org/docs/adapter.html do mention it but are not so clear.
Would you please help me?
Thanks a lot.