public inbox for [email protected]  
help / color / mirror / Atom feed
From: kimaidou <[email protected]>
To: Tom Lane <[email protected]>
Cc: postgres performance list <[email protected]>
Subject: Re: Bad perf when using DECLARE CURSOR on big table
Date: Tue, 18 Mar 2025 08:48:53 +0100
Message-ID: <CAMKXKO4OoEaFcfTeZZOx_icTVdUN8a5LKs=VKTpVqQ-jv27Qww@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAMKXKO6_evfQp80xx5tFkoziHW+62mHg=YKenUEb5VTdnXT=Sg@mail.gmail.com>
	<[email protected]>

Indeed, increasing cursor_tuple_fraction TO 0.2 did the trick.
Thanks for the hint Tom !

Le lun. 17 mars 2025 à 16:22, Tom Lane <[email protected]> a écrit :

> kimaidou <[email protected]> writes:
> > I have seen that this DECLARE has bad perf compared to a simple SQL
> query :
>
> > Simple SQL query
> > =====
> > https://explain.dalibo.com/plan/042bc4dc2449adfe
> > 96ms
>
> > DECLARE CURSOR for the same query
> > =====
> > https://explain.dalibo.com/plan/bh83fc0db500a79g#
> > 171 031 ms !!
>
> Raising cursor_tuple_fraction would probably help this case.
>
>                         regards, tom lane
>


view thread (3+ messages)

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Bad perf when using DECLARE CURSOR on big table
  In-Reply-To: <CAMKXKO4OoEaFcfTeZZOx_icTVdUN8a5LKs=VKTpVqQ-jv27Qww@mail.gmail.com>

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

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