You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@asterixdb.apache.org by Wail Alkowaileet <wa...@gmail.com> on 2015/12/27 14:41:50 UTC

LIMIT push down doesn't really LIMIT the source op.

Hi all,

I was working on a large external dataset and when I query something with
LIMIT clause, I see that the job waits for the
ExternalDataScanOperatorDescriptor to finish scanning the whole file.

When I looked at the plan, I found that the limit operator described
in StreamLimitRuntimeFactory.
The implementation only skips the frames when the limit expression reached
and it doesn't *finalize/stop* the source operator from pushing frames,
which halts the overall job.

            public void nextFrame(ByteBuffer buffer) throws
HyracksDataException {
                if (afterLastTuple) {
                    return; //Accepting frames without appending it to the
parent operator
                }

I think that applied for any source operator.



-- 

*Regards,*
Wail Alkowaileet

Re: LIMIT push down doesn't really LIMIT the source op.

Posted by Taewoo Kim <wa...@gmail.com>.
I'm sorry that I missed this posting. Given our PUSH based architecture, I
am not sure LIMIT operator can "finalize/stop" frames from its input side.
To remedy this issue, we are working on LIMIT pushdown, which passes LIMIT
information to an index-search or external-sort so that only certain number
of tuples will be generated from the source.

Best,
Taewoo

On Wed, Dec 30, 2015 at 11:09 AM, Chen Li <ch...@gmail.com> wrote:

> Maybe Jianfeng and Taewoo can provide some input?
>
> On Sun, Dec 27, 2015 at 5:41 AM, Wail Alkowaileet <wa...@gmail.com>
> wrote:
> > Hi all,
> >
> > I was working on a large external dataset and when I query something with
> > LIMIT clause, I see that the job waits for the
> > ExternalDataScanOperatorDescriptor to finish scanning the whole file.
> >
> > When I looked at the plan, I found that the limit operator described
> > in StreamLimitRuntimeFactory.
> > The implementation only skips the frames when the limit expression
> reached
> > and it doesn't *finalize/stop* the source operator from pushing frames,
> > which halts the overall job.
> >
> >             public void nextFrame(ByteBuffer buffer) throws
> > HyracksDataException {
> >                 if (afterLastTuple) {
> >                     return; //Accepting frames without appending it to
> the
> > parent operator
> >                 }
> >
> > I think that applied for any source operator.
> >
> >
> >
> > --
> >
> > *Regards,*
> > Wail Alkowaileet
>

Re: LIMIT push down doesn't really LIMIT the source op.

Posted by Chen Li <ch...@gmail.com>.
Maybe Jianfeng and Taewoo can provide some input?

On Sun, Dec 27, 2015 at 5:41 AM, Wail Alkowaileet <wa...@gmail.com> wrote:
> Hi all,
>
> I was working on a large external dataset and when I query something with
> LIMIT clause, I see that the job waits for the
> ExternalDataScanOperatorDescriptor to finish scanning the whole file.
>
> When I looked at the plan, I found that the limit operator described
> in StreamLimitRuntimeFactory.
> The implementation only skips the frames when the limit expression reached
> and it doesn't *finalize/stop* the source operator from pushing frames,
> which halts the overall job.
>
>             public void nextFrame(ByteBuffer buffer) throws
> HyracksDataException {
>                 if (afterLastTuple) {
>                     return; //Accepting frames without appending it to the
> parent operator
>                 }
>
> I think that applied for any source operator.
>
>
>
> --
>
> *Regards,*
> Wail Alkowaileet