> 40708acd6 added code to have EXPLAIN ANALYZE show the memory or disk
> usage for Material nodes.
You mean 1eff8279d?
> This isn't quite right as if the material
> node is rescanned, tuplestore_end() is called and that will result in
> the memory usage for that scan being forgotten. What EXPLAIN reports
> is the memory used by the final Material rescan. If that's
> significantly less than some other rescan, then that's misleading.
>
> The fix is fairly simple, just use tuplestore_clear() instead of
> tuplestore_end(). The existing code seems to handle no longer
> NULLifying the tuplestore due to the tuplestore_ateof() check.
The patch looks good to me.
> The misreporting of the storage likely isn't a big deal. I suspect
> rescans of Material nodes are not massively common, so maybe it's not
> worth backpatching a fix.
I have no evidence but I feel same as you (rescans of Material nodes
are not massively common). Probably it's not worth backpatching. If we
need backpatching, we could do it later.
Regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp