On Mon, Apr 13, 2020 at 9:53 PM Tom Lane <t...@sss.pgh.pa.us> wrote: > Richard Guo <guofengli...@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 cannot happen though. Thanks Richard