Remove redundant initialization of smgr pointer for relcache
Remove redundant initialization of smgr pointer for relcache
Hi~ We seem to have a reduntant initialization of rd_smgr for a newly created relcache entry. Commonly, the pointer is assigned as NULL after a relcache is palloc'ed. But this one seems unnecessary because the rd_smgr has already been initialized by earlier AllocateRelationDesc. Propose a patch for it. -- Regards, Jingtang
Re: Remove redundant initialization of smgr pointer for relcache
От:
Zsolt Parragi <zsolt.parragi@percona.com>
Дата:
Hello! This is a simple change, and should work correctly. However, I think I would do more, as this part of the code is just confusing. * AllocateRelationDesc only has one caller * Its description comment only mentions some things it does, not all of them. The call site explains it differently, but also not completely. I would at least also modify the comments so that they are only at one place and explain the function correctly. But maybe it would be even better to remove this function completely or to modify it so it's usable at multiple places?