Re: Cursor with hold for select takes too long

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bindra Bambharoliya <bindra(dot)bambharoliya(at)gmail(dot)com>
Cc: Erik Brandsberg <erik(at)heimdalldata(dot)com>, pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: Re: Cursor with hold for select takes too long
Date: 2024-03-22 17:57:33
Message-ID: 986896.1711130253@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Bindra Bambharoliya <bindra(dot)bambharoliya(at)gmail(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jamie Thompson 2024-03-22 19:51:33 Re: UPDATE with AND clarification
Previous Message Bindra Bambharoliya 2024-03-22 17:47:11 Re: Cursor with hold for select takes too long