From: | Thomas Munro <thomas(dot)munro(at)gmail(dot)com> |
---|---|
To: | Andres Freund <andres(at)anarazel(dot)de> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Some read stream improvements |
Date: | 2025-03-18 07:11:41 |
Message-ID: | CA+hUKGKJ6pMvtXmmts87N7-0qOdMRmYZkm3GDw=mdzHNw4X61A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Mar 18, 2025 at 5:56 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
> So one thing is that the pin count differs by 1 at the start of the scan. No
> idea why.
>
> I still don't know what drives the difference between freebsd and the rest,
> but IIUC the reason this fails is just that we are holding too many buffers
> pinned, due to some buffers being pinned outside of read_stream.c.
I couldn't reproduce this on my local FreeBSD box, but I think I see
one part of the problem: the cursor a few lines up has a stream with a
higher distance holding a couple of pins. Not sure how the local
buffer pool got into a state that caused that if it isn't doing the
same on other machines, but anyway, if I read the test right you
intend to pin strictly one page per cursor, so I tried saying so
explicitly:
- query = format($q$DECLARE %I CURSOR FOR SELECT ctid FROM
test_temp WHERE ctid >= '( %s, 1)'::tid $q$, cursorname, i);
+ query = format($q$DECLARE %I CURSOR FOR SELECT ctid FROM
test_temp WHERE ctid between '(%s, 1)'::tid and '(%s, 9999)'::tid $q$,
cursorname, i, i);
That passed on the FreeBSD CI task.
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2025-03-18 07:31:06 | Re: [PATCH] Optionally record Plan IDs to track plan changes for a query |
Previous Message | David Rowley | 2025-03-18 06:54:02 | Re: maintenance_work_mem = 64kB doesn't work for vacuum |