Richard Guo <guofenglinux@gmail.com> writes: > At first I was wondering if we need to check whether HashState.hashtable > is not NULL in ExecShutdownHash() before we decide to allocate save > space for HashState.hinstrument. And then I convinced myself that that's > not necessary since HashState.hinstrument and HashState.hashtable cannot > be both NULL there.
Even if the hashtable is null at that point, creating an all-zeroes hinstrument struct is harmless.
Correct. The only benefit we may get from checking if the hashtable is null is to avoid an unnecessary palloc0 for hinstrument. But that case