| From: | kimaidou <kimaidou(at)gmail(dot)com> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | postgres performance list <pgsql-performance(at)postgresql(dot)org> |
| Subject: | Re: Bad perf when using DECLARE CURSOR on big table |
| Date: | 2025-03-18 07:48:53 |
| Message-ID: | CAMKXKO4OoEaFcfTeZZOx_icTVdUN8a5LKs=VKTpVqQ-jv27Qww@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-performance |
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 <tgl(at)sss(dot)pgh(dot)pa(dot)us> a écrit :
> 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
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Adithya Kumaranchath | 2025-03-19 12:07:02 | PostgreSQL 16 - Detach partition with FK - Error |
| Previous Message | Pavel Stehule | 2025-03-18 05:46:09 | Re: Re: proposal: schema variables |