Re: [HACKERS] ArrayLists instead of List (for some things)

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: [HACKERS] ArrayLists instead of List (for some things)
Дата
Msg-id CAKJS1f_H6_=LtqE-TQziRaSK1DRqo2UjRt93y3zCufHm7YkNEg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] ArrayLists instead of List (for some things)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, 3 Nov 2017 at 03:17, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> David Rowley <david.rowley@2ndquadrant.com> writes:
> > Comments on the design are welcome, but I was too late to the
> > commitfest, so there are other priorities. However, if you have a
> > strong opinion, feel free to voice it.
>
> I do not like replacing Lists piecemeal; that's a recipe for ongoing
> API breakage and back-patching pain.  Plus we'll then have *four*
> different linked-list implementations in the backend, which sure
> seems like too many.
>
> We've jacked up the List API and driven a new implementation underneath
> once before.  Maybe it's time to do that again.

(reviving this old thread as it's still on my list of things to work on)

How would you feel if I submitted a patch that changed all locations
where we test for an empty list with: if (list) or if (list == NIL) to
a more standard form of if (list_is_empty(list)) ?

The idea here is that I'd like a way to preallocate memory for a list
to a given size before we start populating it, and that flies in the
face of how we currently test for list emptiness.

Such a macro could be backpatched to assist extensions.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Performance issue in foreign-key-aware join estimation
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Use an enum for RELKIND_*?