Re: Questions about `order by column`

2020-11-03 Thread Haisheng Yuan
>  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  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
> 


Questions about `order by column`

2020-11-03 Thread Xiangwei Wei
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