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

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)  latest in thread

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: <[email protected]>

* 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