Re: Removed extra memory allocations from create_list_bounds

Поиск
Список
Период
Сортировка
Искать
От
Justin Pryzby
Тема
Re: Removed extra memory allocations from create_list_bounds
Дата
в 17:00:29
Msg-id
20210516170029.GB373@telsasoft.com
Ответ на
Список
Дерево обсуждения
Removed extra memory allocations from create_list_bounds Nitin Jadhav <nitinjadhavpostgres@gmail.com>
Re: Removed extra memory allocations from create_list_bounds Justin Pryzby <pryzby@telsasoft.com>
Re: Removed extra memory allocations from create_list_bounds Zhihong Yu <zyu@yugabyte.com>
Re: Removed extra memory allocations from create_list_bounds Nitin Jadhav <nitinjadhavpostgres@gmail.com>
Re: Removed extra memory allocations from create_list_bounds Justin Pryzby <pryzby@telsasoft.com>
Re: Removed extra memory allocations from create_list_bounds Nitin Jadhav <nitinjadhavpostgres@gmail.com>
Re: Removed extra memory allocations from create_list_bounds Robert Haas <robertmhaas@gmail.com>
Re: Removed extra memory allocations from create_list_bounds Nitin Jadhav <nitinjadhavpostgres@gmail.com>
Re: Removed extra memory allocations from create_list_bounds Nitin Jadhav <nitinjadhavpostgres@gmail.com>
Re: Removed extra memory allocations from create_list_bounds David Rowley <dgrowleyml@gmail.com>
Re: Removed extra memory allocations from create_list_bounds Justin Pryzby <pryzby@telsasoft.com>
Re: Removed extra memory allocations from create_list_bounds David Rowley <dgrowleyml@gmail.com>
Re: Removed extra memory allocations from create_list_bounds Justin Pryzby <pryzby@telsasoft.com>
Re: Removed extra memory allocations from create_list_bounds David Rowley <dgrowleyml@gmail.com>
Re: Removed extra memory allocations from create_list_bounds Zhihong Yu <zyu@yugabyte.com>
On Sat, May 15, 2021 at 02:40:45PM +0530, Nitin Jadhav wrote:
> While working on [1], I observed that extra memory is allocated in
> [1] https://mail.google.com/mail/u/2/#search/multi+column+list/KtbxLxgZZTjRxNrBWvmHzDTHXCHLssSprg?compose=CllgCHrjDqKgWCBNMmLqhzKhmrvHhSRlRVZxPCVcLkLmFQwrccpTpqLNgbWqKkTkTFCHMtZjWnV

This is a link to your gmail, not to anything public.

If it's worth counting list elements in advance, then you can also allocate the
PartitionListValue as a single chunk, rather than palloc in a loop.
This may help large partition heirarchies.

And the same thing in create_hash_bounds with hbounds.

create_range_bounds() already doesn't call palloc in a loop.  However, then
there's an asymmetry in create_range_bounds, which is still takes a
double-indirect pointer.

I'm not able to detect that this is saving more than about ~1% less RAM, to
create or select from 1000 partitions, probably because other data structures
are using much more, and savings here are relatively small.

I'm going to add to the next CF.  You can add yourself as an author, and watch
that the patch passes tests in cfbot.
https://commitfest.postgresql.org/
http://cfbot.cputube.org/

Thanks,
-- 
Justin
В списке pgsql-hackers по дате отправления
От: Nitin Jadhav
Дата:
От: Tom Lane
Дата:
FAQ