Re: Is custom MemoryContext prohibited?

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Is custom MemoryContext prohibited?
Дата
Msg-id CA+TgmoY+Bnb-2RsmwJG3pVa=UhQVQN+_QsPZBP30C23L1MT+uw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Is custom MemoryContext prohibited?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Is custom MemoryContext prohibited?
Список pgsql-hackers
On Wed, Feb 5, 2020 at 10:56 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Doesn't the proposed magic number address this concern?
>
> No, because (a) it will be a random magic number that nobody will
> remember, and gdb won't print in any helpful form; (b) at least
> as I understood the proposal, there'd be just one magic number for
> all types of memory context.

I don't disagree with the factual statements that you are making but I
don't understand why any of them represent real problems.

- It's true that magic numbers are generally not chosen for easy
memorization, but I think that most experienced hackers don't have
much trouble looking them up with 'git grep' on those (generally rare)
occasions when they are needed.

- It's true that gdb's default format is decimal and you might want
hex, but it has a 'printf' command that can be used to do that, which
I at least have found to be pretty darn convenient for this sort of
thing.

- And it's true that I was proposing - with your agreement, or so I
had understood - one magic number for all context types, but that was
specifically so you could tell whether you had a memory context or
some other thing. Once you know it's really a memory context, you
could print cxt->methods->name.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dmitry Dolgov
Дата:
Сообщение: Re: Index Skip Scan
Следующее
От: Mark Dilger
Дата:
Сообщение: Re: [HACKERS] advanced partition matching algorithm forpartition-wise join