Re: Cursor with hold for select takes too long - Mailing list pgsql-sql

From Erik Brandsberg
Subject Re: Cursor with hold for select takes too long
Date
Msg-id CAFcck8HEJa8-53SNWxMd_8D732skiihM4S7YEsEW63swywFosg@mail.gmail.com
Whole thread Raw
In response to Cursor with hold for select takes too long  (Bindra Bambharoliya <bindra.bambharoliya@gmail.com>)
Responses Re: Cursor with hold for select takes too long  (Bindra Bambharoliya <bindra.bambharoliya@gmail.com>)
List pgsql-sql
What is the actual query being done, and how many rows are being returned?  Depending on the query, it could change the execution path, so this is critical to understand.  If you are doing an order by on a large result-set, it may be doing a huge amount of processing to get your first 100 rows.

On Fri, Mar 22, 2024 at 12:50 PM Bindra Bambharoliya <bindra.bambharoliya@gmail.com> wrote:
Hi team,
I am facing issues with cursor with hold for select.

If I execute select quaery without cursor it takes 13 seconds,
If execute it like 
Begin;
Cursor "sql1" with hold for select.... ;fetch 100 to "sql1"
It takes more than 3 minutes.
Even sometimes it takes more than 10 minutes.

What could be the problem?
Request to help on this ASAP.
I am facing this issue on production. 
I checked locks etc. But nothing like that.


Thanks & Regards
Bindra

pgsql-sql by date:

Previous
From: Bindra Bambharoliya
Date:
Subject: Cursor with hold for select takes too long
Next
From: Bindra Bambharoliya
Date:
Subject: Re: Cursor with hold for select takes too long