Re: Review: Hot standby
От | Alvaro Herrera |
---|---|
Тема | Re: Review: Hot standby |
Дата | |
Msg-id | 20081122141425.GA3813@alvh.no-ip.org обсуждение исходный текст |
Ответ на | Re: Review: Hot standby ("Pavan Deolasee" <pavan.deolasee@gmail.com>) |
Список | pgsql-hackers |
Pavan Deolasee escribió: > On Fri, Nov 21, 2008 at 6:59 PM, Simon Riggs <simon@2ndquadrant.com> wrote: > > > The malloc was part of the existing code, explained by comments. > > Oh I see. But I don't see any explanations for using malloc instead of > palloc. Not that the current patch is responsible for this, I am wondering > why its done that way and if we are freeing the malloced memory at all ? It's an optimization. We don't ever free it -- we alloc it once (the first time the snapshot is taken) and then the allocated space is reused until the backend dies. The reason for not using palloc is that if you're not going to do any context-related management, what would be the point? We save the palloc overhead this way (admittedly not a lot). -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.
В списке pgsql-hackers по дате отправления: