Re: Cursor with hold for select takes too long

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bindra Bambharoliya <bindra.bambharoliya@gmail.com>
Cc: Erik Brandsberg <erik@heimdalldata.com>, pgsql-sql@lists.postgresql.org
Date: 2024-03-22T17:57:33Z
Lists: pgsql-sql
Bindra Bambharoliya <bindra.bambharoliya@gmail.com> writes:
> Query is like
> Select a.id, sum(b.amount),
> Count(c.am_id) ... from fact.a join fact.b on a.id= b.id join
> Fact.vw_c on a.ida=vw_c.ida group by a.id;

Is the query plan the same for cursor execution as regular?
Compare EXPLAIN SELECT ... versus EXPLAIN DECLARE x CURSOR FOR SELECT ...

(I'm not sure that WITH HOLD would make a difference, so
maybe compare with and without that, too.)

			regards, tom lane