Re: [HACKERS] ArrayLists instead of List (for some things)
От
Tom Lane
Тема
Re: [HACKERS] ArrayLists instead of List (for some things)
Дата
Msg-id
30137.1509634430@sss.pgh.pa.us
Ответ на
Re: [HACKERS] ArrayLists instead of List (for some things) (David Rowley)
Список
Дерево обсуждения
[HACKERS] ArrayLists instead of List (for some things) David Rowley <david.rowley@2ndquadrant.com>
Re: [HACKERS] ArrayLists instead of List (for some things) Stephen Frost <sfrost@snowman.net>
Re: [HACKERS] ArrayLists instead of List (for some things) David Rowley <david.rowley@2ndquadrant.com>
Re: [HACKERS] ArrayLists instead of List (for some things) Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] ArrayLists instead of List (for some things) David Rowley <david.rowley@2ndquadrant.com>
Re: [HACKERS] ArrayLists instead of List (for some things) David Rowley <david.rowley@2ndquadrant.com>
Re: [HACKERS] ArrayLists instead of List (for some things) Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] ArrayLists instead of List (for some things) Andres Freund <andres@anarazel.de>
Re: [HACKERS] ArrayLists instead of List (for some things) David Rowley <david.rowley@2ndquadrant.com>
Re: [HACKERS] ArrayLists instead of List (for some things) Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] ArrayLists instead of List (for some things) Craig Ringer <craig@2ndquadrant.com>
Re: [HACKERS] ArrayLists instead of List (for some things) David Rowley <david.rowley@2ndquadrant.com>
Re: [HACKERS] ArrayLists instead of List (for some things) Craig Ringer <craig@2ndquadrant.com>
Re: [HACKERS] ArrayLists instead of List (for some things) Craig Ringer <craig@2ndquadrant.com>
David Rowley writes: >> It seems to me that a whole lot of the complaints about this could be >> resolved simply by improving the List infrastructure to allocate ListCells >> in batches. That would address the question of "too much palloc traffic" >> and greatly improve the it-accesses-all-over-memory situation too. >> >> Possibly there are more aggressive changes that could be implemented >> without breaking too many places, but I think it would be useful to >> start there and see what it buys us. > Yeah, certainly would be a good way of determining the worth of changing. BTW, with just a little more work that could be made to address the list-nth-is-expensive problem too. I'm imagining a call that preallocates an empty list with room for N ListCells (or perhaps, if we need to preserve compatibility with NIL == NULL, creates a single-element list with room for N-1 more cells), plus some tracking in list.c of whether the list cells have been consumed in order. Given the typical use-case of building lists strictly with lappend, list_nth() could index directly into the ListCell slab as long as it saw the List header's "is_linear" flag was true. regards, tom lane -- 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 по дате отправления
От: David Rowley
Дата:
От: David Rowley
Дата: