Re: Progress report of CREATE INDEX for nested partitioned tables

Поиск
Список
Период
Сортировка
Искать
От
Ilya Gladyshev
Тема
Re: Progress report of CREATE INDEX for nested partitioned tables
Дата
Msg-id
5073D187-4200-4A2D-BAC0-91C657E3C22E@gmail.com
Ответ на
Список
Дерево обсуждения
Progress report of CREATE INDEX for nested partitioned tables Ilya Gladyshev <ilya.v.gladyshev@gmail.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Ilya Gladyshev <ilya.v.gladyshev@gmail.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Ilya Gladyshev <ilya.v.gladyshev@gmail.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Ilya Gladyshev <ilya.v.gladyshev@gmail.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Tomas Vondra <tomas.vondra@enterprisedb.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Dean Rasheed <dean.a.rasheed@gmail.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Tomas Vondra <tomas.vondra@enterprisedb.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Ilya Gladyshev <ilya.v.gladyshev@gmail.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Ilya Gladyshev <ilya.v.gladyshev@gmail.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Progress report of CREATE INDEX for nested partitioned tables Ilya Gladyshev <ilya.v.gladyshev@gmail.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Matthias van de Meent <boekewurm+postgres@gmail.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Matthias van de Meent <boekewurm+postgres@gmail.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Ilya Gladyshev <ilya.v.gladyshev@gmail.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Matthias van de Meent <boekewurm+postgres@gmail.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Tom Lane <tgl@sss.pgh.pa.us>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Tom Lane <tgl@sss.pgh.pa.us>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Tom Lane <tgl@sss.pgh.pa.us>
Re: Progress report of CREATE INDEX for nested partitioned tables Tom Lane <tgl@sss.pgh.pa.us>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Tom Lane <tgl@sss.pgh.pa.us>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Tom Lane <tgl@sss.pgh.pa.us>
Re: Progress report of CREATE INDEX for nested partitioned tables Ilya Gladyshev <ilya.v.gladyshev@gmail.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Ilya Gladyshev <ilya.v.gladyshev@gmail.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Tom Lane <tgl@sss.pgh.pa.us>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Tom Lane <tgl@sss.pgh.pa.us>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>
Re: Progress report of CREATE INDEX for nested partitioned tables Tom Lane <tgl@sss.pgh.pa.us>
Re: Progress report of CREATE INDEX for nested partitioned tables Tom Lane <tgl@sss.pgh.pa.us>
Re: Progress report of CREATE INDEX for nested partitioned tables Justin Pryzby <pryzby@telsasoft.com>

> 1 февр. 2023 г., в 16:01, Alvaro Herrera  написал(а):
> 
> Hmm, count_leaf_partitions has to scan pg_inherits and do a syscache
> lookup for every single element therein ... this sounds slow. 
> 
> In one of the callsites, we already have the partition descriptor
> available.  We could just scan partdesc->is_leaf[] and add one for each
> 'true' value we see there.

The problem is that partdesc contains only direct children of the table and we need all the children down the inheritance tree to count the total number of leaf partitions in the first callsite.

> In the other callsite, we had the table open just a few lines before the
> place you call count_leaf_partitions.  Maybe we can rejigger things by
> examining its state before closing it: if relkind is not partitioned we
> know leaf_partitions=0, and only if partitioned we count leaf partitions.
> I think that would save some work.  I also wonder if it's worth writing
> a bespoke function for counting leaf partitions rather than relying on
> find_all_inheritors.

Sure, added this condition to avoid the extra work here.



В списке pgsql-hackers по дате отправления
От: David Geier
Дата:
От: Robert Haas
Дата:
FAQ