hubert depesz lubaczewski <depesz@depesz.com> writes:
> why is it not limiting generate_series in the second example?
nodeFunctionscan.c sucks the whole SRF output into a tuplestore before
returning any of it. In principle you could do something different for
a value-per-call SRF, but it would require a second whole code path
(or else major refactoring of ExecMakeTableFunctionResult and related
code). The performance implications are unclear too.
I seem to recall there was some discussion of this point when that code
was first written, but nobody bothered to do anything about it.
regards, tom lane