Alexander Korotkov <a.korotkov@postgrespro.ru> wrote:
> Antonin Houska <ah@cybertec.at> wrote:
> > * ExecIncrementalSort()
> >
> > ** if (node->tuplesortstate == NULL)
> >
> > If both branches contain the expression
> >
> > node->groupsCount++;
> >
> > I suggest it to be moved outside the "if" construct.
>
> Done.
One more comment on this: I wonder if the field isn't incremented too
early. It seems to me that the value can end up non-zero if the input set is
to be empty (not sure if it can happen in practice).
And finally one question about regression tests: what's the purpose of the
changes in contrib/postgres_fdw/sql/postgres_fdw.sql ? I see no
IncrementalSort node in the output.
--
Antonin Houska
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt
Web: http://www.postgresql-support.de, http://www.cybertec.at