Re: Move pg_attribute.attcompression to earlier in struct for reduced size?
От | Dilip Kumar |
---|---|
Тема | Re: Move pg_attribute.attcompression to earlier in struct for reduced size? |
Дата | |
Msg-id | CAFiTN-uLQCRLatapZhEaNGH9njY=LndyXJux7H9YCfT9RcE7gA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Move pg_attribute.attcompression to earlier in struct for reduced size? (Michael Paquier <michael@paquier.xyz>) |
Ответы |
Re: Move pg_attribute.attcompression to earlier in struct for reduced size?
|
Список | pgsql-hackers |
On Mon, May 24, 2021 at 9:39 AM Michael Paquier <michael@paquier.xyz> wrote: > > On Fri, May 21, 2021 at 02:19:29PM -0700, Andres Freund wrote: > > During VACUUM FULL reform_and_rewrite_tuple() detoasts the old value if > > it was compressed with a different method, while in > > TopTransactionContext. There's nothing freeing that until > > TopTransactionContext ends - obviously not great for a large relation > > being VACUUM FULLed. > > Yeah, that's not good. The confusion comes from the fact that we'd > just overwrite the values without freeing them out if recompressed, so > something like the attached would be fine? /* Be sure to null out any dropped columns */ for (i = 0; i < newTupDesc->natts; i++) { + tup_values[i] = values[i]; + if (TupleDescAttr(newTupDesc, i)->attisdropped) isnull[i] = true; I think you don't need to initialize tup_values[i] with the values[i];, other than that looks fine to me. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com
В списке pgsql-hackers по дате отправления: