You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Homer <lo...@gmail.com> on 2015/11/11 18:33:44 UTC
Hoisting literals
Hi,
I am wondering if this is something that has already in calcite but I
cannot seem to find it.
Imagine that it is common to run a large number of very similar machine
generated queries that just change the literals in the sql query
for example (the real queries would be much more complex)
Select * from emp where empno = 1
Select * from emp where empno = 2
...
etc
The plan that is likely being generated for these kind of queries is
going to be very much the same each time, so to save some time, I would
like to recognize that the literals are all that have changed in a query
and use the previously optimized execution plan and just replace the
literals?
Is there anything I can leverage in calcite (or is the functionality
already there?) for this kind of thing?
thanks,
Homer
Re: Hoisting literals
Posted by Julian Hyde <jh...@apache.org>.
It isn’t, but it would be really useful. I’ve logged https://issues.apache.org/jira/browse/CALCITE-963 <https://issues.apache.org/jira/browse/CALCITE-963> with an outline of how it could be implemented.
Julian
> On Nov 11, 2015, at 9:33 AM, Homer <lo...@gmail.com> wrote:
>
> Hi,
>
> I am wondering if this is something that has already in calcite but I cannot seem to find it.
>
> Imagine that it is common to run a large number of very similar machine generated queries that just change the literals in the sql query
>
> for example (the real queries would be much more complex)
>
> Select * from emp where empno = 1
> Select * from emp where empno = 2
> ...
>
> etc
>
> The plan that is likely being generated for these kind of queries is going to be very much the same each time, so to save some time, I would like to recognize that the literals are all that have changed in a query and use the previously optimized execution plan and just replace the literals?
>
> Is there anything I can leverage in calcite (or is the functionality already there?) for this kind of thing?
>
> thanks,
> Homer