Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc> writes:
> it looks like that postgresql is actually allocating the memory for the
> hashtable of the HashAggregate which is a bit unexpected for a plain
> EXPLAIN.
Not really. EXPLAIN runs plan setup (ExecutorStart).
regards, tom lane