The cost isn’t exactly associated with the planner. It is hung off of RelNodes 
by means of metadata providers, so it is more closely associated with RelNodes 
than planner. But anyway, I think what you’re asking for is how to get a 
planning environment with all the costs (aka metadata) available.

You might try running ‘explain plan with implementation for …’ in a debugger 
and put a break point in RelOptUtil.dumpPlan. All of the metadata is available 
as the plan writer (RelWriterImpl) walks over the tree.

Julian


> On Mar 1, 2016, at 11:51 AM, Michael Mior <[email protected]> wrote:
> 
> I'm looking for pointers on how I could write a standalone piece of code
> that interfaces with calcite to get the cost value used by the default
> planner. I'm able to create an instance of CalcitePrepareImpl and execute
> queries, but I don't see an obvious way to pull out the planner instance
> and get the cost from there.
> 
> Any help would be greatly appreciated!
> 
> Cheers,
> --
> Michael Mior
> [email protected]

Reply via email to