Re: Table Function Scan can report incorrect "Maximum Storage" in EXPLAIN - Mailing list pgsql-hackers

From David Rowley
Subject Re: Table Function Scan can report incorrect "Maximum Storage" in EXPLAIN
Date
Msg-id CAApHDvrvUNq_79t4hSpxG_ADOQ5nfvB6E++K386aJyKH9pTZ6w@mail.gmail.com
Whole thread
In response to Table Function Scan can report incorrect "Maximum Storage" in EXPLAIN  (Tatsuya Kawata <kawatatatsuya0913@gmail.com>)
Responses Re: Table Function Scan can report incorrect "Maximum Storage" in EXPLAIN
List pgsql-hackers
On Mon, 5 Oct 2026 at 03:52, Tatsuya Kawata <kawatatatsuya0913@gmail.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



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Fix reindexdb with parallel index-level conrurrent run
Next
From: Joao Detomini
Date:
Subject: Re: pg_resetwal: refuse to run when backup_label exists