Lists: | pgsql-hackers |
---|
From: | Jeremy Harris <jgh(at)wizmail(dot)org> |
---|---|
To: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Questionable coding in orderedsetaggs.c |
Date: | 2014-01-25 18:25:19 |
Message-ID: | 52E4018F.8090606@wizmail.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
In ordered_set_startup() sorts are initialised in non-randomAccess mode
(tuplesort_begin_heap() and ~datum(), last argument).
The use of tuplesort_skip_tuples() feels very like a random access to
me. I think it doesn't fail because the only use (and implementation)
is to skip forwards; if backwards were tried (as the interface permits)
external sorts would fail because multiple tapes are present for
FINALMERGE.
--
Cheers,
Jeremy
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Jeremy Harris <jgh(at)wizmail(dot)org> |
Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Questionable coding in orderedsetaggs.c |
Date: | 2014-01-25 20:04:37 |
Message-ID: | 5069.1390680277@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Jeremy Harris <jgh(at)wizmail(dot)org> writes:
> In ordered_set_startup() sorts are initialised in non-randomAccess mode
> (tuplesort_begin_heap() and ~datum(), last argument).
> The use of tuplesort_skip_tuples() feels very like a random access to
> me. I think it doesn't fail because the only use (and implementation)
> is to skip forwards; if backwards were tried (as the interface permits)
> external sorts would fail because multiple tapes are present for
> FINALMERGE.
Well, we certainly don't want to incur the overhead of randomAccess mode
when we're not actually going to use it, so I'd resist changing the code
in ordered_set_startup().
It's true that if tuplesort_skip_tuples() supported backwards skip, it
would need to insist that randomAccess mode be enabled *when a backwards
skip is used*. But such a feature is purely hypothetical ATM.
regards, tom lane
From: | Atri Sharma <atri(dot)jiit(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, jgh(at)wizmail(dot)org |
Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Questionable coding in orderedsetaggs.c |
Date: | 2014-01-26 03:22:43 |
Message-ID: | CAOeZVifJdS8=8G69h=EfrSiZWawGvjXfm3UxyztZ5OX+UFwT-A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Sunday, January 26, 2014, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Jeremy Harris <jgh(at)wizmail(dot)org <javascript:;>> writes:
> > In ordered_set_startup() sorts are initialised in non-randomAccess mode
> > (tuplesort_begin_heap() and ~datum(), last argument).
>
> > The use of tuplesort_skip_tuples() feels very like a random access to
> > me. I think it doesn't fail because the only use (and implementation)
> > is to skip forwards; if backwards were tried (as the interface permits)
> > external sorts would fail because multiple tapes are present for
> > FINALMERGE.
>
> Well, we certainly don't want to incur the overhead of randomAccess mode
> when we're not actually going to use it, so I'd resist changing the code
> in ordered_set_startup().
>
> It's true that if tuplesort_skip_tuples() supported backwards skip, it
> would need to insist that randomAccess mode be enabled *when a backwards
> skip is used*. But such a feature is purely hypothetical ATM.
>
>
>
+1
In ordered set functions, we normally don't skip backwards and skip tuples
while sorting in,for e.g. Hypothetical set functions in only a forward
manner.
--
Regards,
Atri
*l'apprenant*