Adjust cost model for HashAgg that spills to disk.
authorJeff Davis <jdavis@postgresql.org>
Mon, 7 Sep 2020 20:31:59 +0000 (13:31 -0700)
committerJeff Davis <jdavis@postgresql.org>
Mon, 7 Sep 2020 20:40:16 +0000 (13:40 -0700)
commitb61d048e0d480f4311c62bf3026879c83ba9aaad
tree7087922924be6d0efd73ec3c8e37b00a533a92dc
parente02c99bff6fcf7a14292cf99b16e4810ea89a2de
Adjust cost model for HashAgg that spills to disk.

Tomas Vondra observed that the IO behavior for HashAgg tends to be
worse than for Sort. Penalize HashAgg IO costs accordingly.

Also, account for the CPU effort of spilling the tuples and reading
them back.

Discussion: https://postgr.es/m/20200906212112.nzoy5ytrzjjodpfh@development
Reviewed-by: Tomas Vondra
Backpatch-through: 13
src/backend/optimizer/path/costsize.c