Re: Does SETOF make queries slower?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Eduardo Naschenweng" <eduardo(dot)naschenweng(at)digitro(dot)com(dot)br>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Does SETOF make queries slower?
Date: 2004-04-02 06:26:18
Message-ID: 23048.1080887178@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Eduardo Naschenweng" <eduardo(dot)naschenweng(at)digitro(dot)com(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Bradley Kieser 2004-04-02 10:36:12 Re: Do Petabyte storage solutions exist?
Previous Message Christopher Browne 2004-04-02 02:01:24 Re: plpgsql editor(s)?