Re: Does SETOF make queries slower? - Mailing list pgsql-admin

From Tom Lane
Subject Re: Does SETOF make queries slower?
Date
Msg-id 23048.1080887178@sss.pgh.pa.us
Whole thread Raw
In response to Does SETOF make queries slower?  ("Eduardo Naschenweng" <eduardo.naschenweng@digitro.com.br>)
List pgsql-admin
"Eduardo Naschenweng" <eduardo.naschenweng@digitro.com.br> writes:
> bxs=3D# EXPLAIN ANALYZE SELECT dt_inicial, identidadea FROM cham_chamada cc=
> ;=0D
> [ is faster than ]
> bxs=3D# EXPLAIN ANALYZE SELECT * FROM teste();=0D

nodeFunctionscan.c insists on cramming the results of the function into
a tuplestore and then reading them back.  This is fairly expensive for a
large result set.  I complained about this back when the implementation
was first proposed, but we set the problem aside for the time being, and
it hasn't been revisited.  One reason for it is that a function is by
nature not very transparent, so it's hard to tell whether the storage
overhead is necessary or not.

            regards, tom lane

pgsql-admin by date:

Previous
From: Andrew Biagioni
Date:
Subject: plpgsql editor(s)?
Next
From: Bradley Kieser
Date:
Subject: Re: Do Petabyte storage solutions exist?