Re: Table Function Scan can report incorrect "Maximum Storage" in EXPLAIN

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Tatsuya Kawata <kawatatatsuya0913(at)gmail(dot)com>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Table Function Scan can report incorrect "Maximum Storage" in EXPLAIN
Date: 2026-10-05 03:00:59
Message-ID: CAApHDvrvUNq_79t4hSpxG_ADOQ5nfvB6E++K386aJyKH9pTZ6w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 5 Oct 2026 at 03:52, Tatsuya Kawata <kawatatatsuya0913(at)gmail(dot)com> wrote:
> 40708acd65 added memory/disk usage to EXPLAIN ANALYZE for Table Function
> Scan nodes. However, when the node is rescanned with changed
> parameters, ExecReScanTableFuncScan() calls tuplestore_end(), so the
> statistics of the earlier rescans are lost and only those of the final
> rescan are reported.

I made a very small change so we only call tuplestore_rescan() when
the parameters don't change. The call to tuplestore_clear() rewinds
the read pointers, so there's no point in calling tuplestore_rescan()
after tuplestore_clear().

Pushed. Thanks.

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Michael Paquier 2026-10-05 02:52:23 Re: Fix reindexdb with parallel index-level conrurrent run