Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN
От | David Rowley |
---|---|
Тема | Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN |
Дата | |
Msg-id | CAApHDvpKUooQQ6UoyvUPdwXL+Zzb8ML=gG1Yscdprpz2EC-znQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN (Tatsuo Ishii <ishii@postgresql.org>) |
Ответы |
Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN
|
Список | pgsql-hackers |
On Thu, 19 Sept 2024 at 16:21, Tatsuo Ishii <ishii@postgresql.org> wrote: > Thanks. Attached is a patch for CTE scan, table function scan and > recursive union scan nodes. 1. It's probably a minor detail, but in show_recursive_union_info(), I don't think the tuplestores can ever be NULL. + if (working_table != NULL) + tuplestore_get_stats(working_table, &tempStorageType, &tempSpaceUsed); + + if (intermediate_table != NULL) + tuplestore_get_stats(intermediate_table, &maxStorageType, &maxSpaceUsed); I added the NULL tests for the Materialize case as the tuplestore is created in ExecMaterial() rather than ExecInitMaterial(). For the two tuplestorestates above, they're both created in ExecInitRecursiveUnion(). 2. I imagined you'd always do maxSpaceUsed += tempSpaceUsed; or maxSpaceUsedKB = BYTES_TO_KILOBYTES(maxSpaceUsed + tempSpaceUsed); + if (tempSpaceUsed > maxSpaceUsed) + { + maxStorageType = tempStorageType; + maxSpaceUsed = tempSpaceUsed; + } Why do you think the the space used by the smaller tuplestore should be ignored in the storage size output? David
В списке pgsql-hackers по дате отправления: