You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Xiangwei Wei <wx...@gmail.com> on 2020/11/03 03:05:10 UTC

Questions about `order by column`

Hi all,

I'd like to ask some questions about the Calcite adapter. If `order by` is
not pushed down to the underlying database, then how does Calcite handle
this operator? Will it read all data provided by the underlying database
and enumerate it to sort? If so, how to guarantee the performance while a
large amount of data ?

Sorry to trouble you guys. But look forward to hearing from you :D

-- 
Best,
Xiangwei Wei

Re: Questions about `order by column`

Posted by Haisheng Yuan <hy...@apache.org>.
>  If `order by` is
> not pushed down to the underlying database, then how does Calcite handle
> this operator? 

It will generate a plan with sort operator on top of the data source.

> Will it read all data provided by the underlying database
> and enumerate it to sort?
I believe so.

> If so, how to guarantee the performance while a
> large amount of data?
It is not guaranteed. So better to push down sort into data source, if not, you need to teach the Calcite-based optimizer to push it down.


On 2020/11/03 03:05:10, Xiangwei Wei <wx...@gmail.com> wrote: 
> Hi all,
> 
> I'd like to ask some questions about the Calcite adapter. If `order by` is
> not pushed down to the underlying database, then how does Calcite handle
> this operator? Will it read all data provided by the underlying database
> and enumerate it to sort? If so, how to guarantee the performance while a
> large amount of data ?
> 
> Sorry to trouble you guys. But look forward to hearing from you :D
> 
> -- 
> Best,
> Xiangwei Wei
>