pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Yambu <hyambu@gmail.com>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Refcursor
Date: Mon, 15 Mar 2021 14:39:44 +0100
Message-ID: <8588634ebfd4fa3b0c9a0608e19c30f1cf80c03a.camel@cybertec.at> (raw)
In-Reply-To: <CALhHtcCHJ=qk7E-v4LiOiC=2DDDWjjc_FTPem_8MtbjUEovm4g@mail.gmail.com>
References: <CALhHtcCHJ=qk7E-v4LiOiC=2DDDWjjc_FTPem_8MtbjUEovm4g@mail.gmail.com>

On Mon, 2021-03-15 at 13:58 +0200, Yambu wrote:
> May I know why the below takes so long?
> 
> 
> BEGIN; 
> select * from func1() ; 
> fetch all from "<unnamed portal 1>"; 
> end;  
> 
> Select *  from func1() ;   on its own is very fast

The second just fetches a cursor for the query, the
first executes the query.  Executing the query is what
can take long.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (6+ messages)

Message-ID: <8588634ebfd4fa3b0c9a0608e19c30f1cf80c03a.camel@cybertec.at>
Permalink:  ../8588634ebfd4fa3b0c9a0608e19c30f1cf80c03a.camel@cybertec.at/
Also on:    postgresql.org/message-id/8588634ebfd4fa3b0c9a0608e19c30f1cf80c03a.camel@cybertec.at

 · 

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-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, hyambu@gmail.com
  Subject: Re: Refcursor
  In-Reply-To: <8588634ebfd4fa3b0c9a0608e19c30f1cf80c03a.camel@cybertec.at>
  References: <CALhHtcCHJ=qk7E-v4LiOiC=2DDDWjjc_FTPem_8MtbjUEovm4g@mail.gmail.com> <8588634ebfd4fa3b0c9a0608e19c30f1cf80c03a.camel@cybertec.at>

* 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