pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Eduardo Naschenweng <eduardo.naschenweng@digitro.com.br>
Cc: pgsql-admin@postgresql.org
Subject: Re: Does SETOF make queries slower?
Date: Fri, 02 Apr 2004 01:26:18 -0500
Message-ID: <23048.1080887178@sss.pgh.pa.us> (raw)
In-Reply-To: <406C54C7.000001.00680@dgtat>
References: <406C54C7.000001.00680@dgtat>

"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



view thread (2+ messages)

Message-ID: <23048.1080887178@sss.pgh.pa.us>
Permalink:  ../23048.1080887178@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23048.1080887178@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, eduardo.naschenweng@digitro.com.br
  Subject: Re: Does SETOF make queries slower?
  In-Reply-To: <23048.1080887178@sss.pgh.pa.us>
  References: <406C54C7.000001.00680@dgtat> <23048.1080887178@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox