calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Danny Chan <>
Subject Re: [DISCUSS] Support Sql Hint for Calcite
Date Wed, 16 Oct 2019 06:54:46 GMT
Thanks for the clarification.

I understand you worried. Yes, the effort/memory would be wasted or meaningless if hints are
not used. This is just what a hint does, it is a “hint” and non-mandatory, but we should
give the chance to let user see them, it is the use that decide if to use the hints and how
to use them. For big queries I have no confidence to cover the corner cases. So can we mark
this feature as experimental and used for simple queries(no decorrelation) first ?

For “reversible”, during the implementation, I try to make the modifications non-invasive
with the current codes. That is why I made all the interfaces about the hint into one class
named RelWithHInt. Different with trait, I didn’t force users to pass in the hints in the
RelNode constructor. I think if is not a bigwork if we want to remove the API.

Danny Chan
在 2019年10月16日 +0800 AM11:14,Julian Hyde <>,写道:
> By “skeptical” I mean that I think we can come up with a mechanism to copy hints
when applying planner rules, but even when we have implemented that mechanism there will be
many cases where people want a hint and that hint is not copied to the RelNode where it is
needed, and many other cases where we spend the effort/memory of copying the hint to a RelNode
and the hint is not used.
> By “reversible” I mean if we come up with an API that does not work, how do we change
or remove that API without people complaining?
> Julian
> > On Oct 15, 2019, at 7:11 PM, Danny Chan <> wrote:
> >
> > Thanks Julian
> >
> > > I am skeptical that RelWithHint will work for large queries.
> >
> > For “skeptical” do you mean how to transfer the hints during rule planning ?
I’m also not that confident yet.
> >
> > > How do we introduce it in a reversible way
> > Do you mean transform the RelWithHint back into the SqlHint ? I didn’t implement
it in current patch, but I think we have the ability to do that because we have a inheritPath
for each RelWithHint, we can collect all the hints together and merge them into the SqlHints,
then propagate these SqlHints to the SqlNodes.
> >
> > > What are the other options?
> > Do you mean the way to transfer hints during planning ? I have no other options
> >
> > Best,
> > Danny Chan
> > 在 2019年10月16日 +0800 AM8:03,,写道:
> > >
> > > I am skeptical that RelWithHint will work for large queries.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message