Re: Pre-alloc ListCell's optimization

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Pre-alloc ListCell's optimization
Дата
Msg-id BANLkTimonxq4q2aVDohb5ww+MXZrRY8nmg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Pre-alloc ListCell's optimization  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: Pre-alloc ListCell's optimization
Список pgsql-hackers
On Thu, May 26, 2011 at 8:52 PM, Stephen Frost <sfrost@snowman.net> wrote:
>  list_concat() does explicitly say that cells will
> be shared afterwards and that you can't pfree() either list (note that
> there's actually a couple cases currently that I discovered which were
> also addressed in the original patch where I commented out those
> pfree()'s).

So in traditional list it would splice the second argument onto the
end of the first list. This has a few effects that it sounds like you
haven't preserved. For example if I insert an element anywhere in
list2 -- including in the first few elements -- it's also inserted
into list1.

I'm not really sure we care about these semantics with our lists
though. It's not like they're supposed to be a full-featured lisp
emulator and it's not like the C code pulls any particularly clever
tricks with lists. I suspect we may have already broken these
semantics long ago but I haven't looked to see if that's the case.




--
greg


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

Предыдущее
От: Vaibhav Kaushal
Дата:
Сообщение: Re: Expression Evaluator used for creating the plan tree / stmt ?
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Pre-alloc ListCell's optimization