Re: [HACKERS] Proposal: Local indexes for partitioned table

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: [HACKERS] Proposal: Local indexes for partitioned table
Дата
Msg-id 20171103173042.rgtuwowlfbv54sae@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: [HACKERS] Proposal: Local indexes for partitioned table  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Proposal: Local indexes for partitioned table
Список pgsql-hackers
> Robert Haas <robertmhaas@gmail.com> writes:

> > We could do that, but the motivation for the current system was to
> > avoid leaking memory in a long-lived context.

Yeah, my approach here is to use a CATCH block that deletes the memory
context just created, thus avoiding a long-lived leak.

Tom Lane wrote:

> Another key point is to avoid leaving a corrupted relcache entry behind
> if you fail partway through.

Sure ... in the code as I have it we only assign the local variable to
the relcache entry if everything is succesful.  So no relcache
corruption should result.

> It might work to build the new key in a context that's initially a
> child of CurrentMemoryContext, then reparent it to be a child of
> CacheMemoryContext when done. 

That's another way (than the PG_TRY block), but I think it's more
complicated with no gain.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] Subscriber resets additional columns to NULL on UPDATE
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [HACKERS] ucs_wcwidth vintage