Re: Bad perf when using DECLARE CURSOR on big table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: kimaidou <kimaidou(at)gmail(dot)com>
Cc: postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Bad perf when using DECLARE CURSOR on big table
Date: 2025-03-17 15:22:57
Message-ID: 4008327.1742224977@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

kimaidou <kimaidou(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Renan Alves Fonseca 2025-03-17 17:45:50 Re: Bulk DML performance
Previous Message kimaidou 2025-03-17 14:41:07 Bad perf when using DECLARE CURSOR on big table