Re: Creating foreign key on partitioned table is too slow

Поиск
Список
Период
Сортировка
Искать
От
Alvaro Herrera
Тема
Re: Creating foreign key on partitioned table is too slow
Дата
Msg-id
20200324152623.GA21637@alvherre.pgsql
Ответ на
Список
Дерево обсуждения
Creating foreign key on partitioned table is too slow "kato-sho@fujitsu.com" <kato-sho@fujitsu.com>
Re: Creating foreign key on partitioned table is too slow Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Creating foreign key on partitioned table is too slow Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: Creating foreign key on partitioned table is too slow Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: Creating foreign key on partitioned table is too slow Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Creating foreign key on partitioned table is too slow Tom Lane <tgl@sss.pgh.pa.us>
Re: Creating foreign key on partitioned table is too slow Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Creating foreign key on partitioned table is too slow Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Creating foreign key on partitioned table is too slow David Steele <david@pgmasters.net>
Re: Creating foreign key on partitioned table is too slow Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Creating foreign key on partitioned table is too slow Daniel Gustafsson <daniel@yesql.se>
RE: Creating foreign key on partitioned table is too slow "kato-sho@fujitsu.com" <kato-sho@fujitsu.com>
RE: Creating foreign key on partitioned table is too slow "kato-sho@fujitsu.com" <kato-sho@fujitsu.com>
Re: Creating foreign key on partitioned table is too slow Amit Langote <amitlangote09@gmail.com>
Re: Creating foreign key on partitioned table is too slow Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Creating foreign key on partitioned table is too slow Amit Langote <amitlangote09@gmail.com>
Re: Creating foreign key on partitioned table is too slow Amit Langote <amitlangote09@gmail.com>
Re: Creating foreign key on partitioned table is too slow Tom Lane <tgl@sss.pgh.pa.us>
Re: Creating foreign key on partitioned table is too slow Alec Lazarescu <alecl@alecl.com>
Re: Creating foreign key on partitioned table is too slow Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Re: Creating foreign key on partitioned table is too slow Robert Haas <robertmhaas@gmail.com>
Re: Creating foreign key on partitioned table is too slow Amit Langote <amitlangote09@gmail.com>
Re: Creating foreign key on partitioned table is too slow Andres Freund <andres@anarazel.de>
Re: Creating foreign key on partitioned table is too slow Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: Creating foreign key on partitioned table is too slow David Rowley <david.rowley@2ndquadrant.com>
Re: Creating foreign key on partitioned table is too slow Tom Lane <tgl@sss.pgh.pa.us>
Re: Creating foreign key on partitioned table is too slow David Rowley <david.rowley@2ndquadrant.com>
Re: Creating foreign key on partitioned table is too slow Andres Freund <andres@anarazel.de>
On 2020-Mar-24, David Steele wrote:

> This patch still applies but there seems to be some disagreement on
> how to proceed.

Actually, I don't think there's any disagreement regarding the patch I
last posted.  (There was disagreement on the previous patches, which
were very different).  Tom suggested to look at the heuristics used for
RECOVER_RELATION_BUILD_MEMORY, and the patch does exactly that.  It
would be great if Kato Sho can try the original test case with my latest
patch (the one in https://postgr.es/m/20191113214544.GA16060@alvherre.pgsql )
and let us know if it improves things.

The patch as posted generates these warnings in my current GCC that it
didn't when I checked last, but they're harmless -- if/when I push,
it'll be without the parens.

/pgsql/source/master/src/backend/utils/cache/relcache.c:1064:21: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
        if ((relp->relkind == RELKIND_PARTITIONED_TABLE)
             ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/pgsql/source/master/src/backend/utils/cache/relcache.c:1064:21: note: remove extraneous parentheses around the comparison to silence this warning
        if ((relp->relkind == RELKIND_PARTITIONED_TABLE)
            ~              ^                           ~
/pgsql/source/master/src/backend/utils/cache/relcache.c:1064:21: note: use '=' to turn this equality comparison into an assignment
        if ((relp->relkind == RELKIND_PARTITIONED_TABLE)
                           ^~
                           =
/pgsql/source/master/src/backend/utils/cache/relcache.c:1242:33: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
        if ((relation->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
             ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/pgsql/source/master/src/backend/utils/cache/relcache.c:1242:33: note: remove extraneous parentheses around the comparison to silence this warning
        if ((relation->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
            ~                          ^                           ~
/pgsql/source/master/src/backend/utils/cache/relcache.c:1242:33: note: use '=' to turn this equality comparison into an assignment
        if ((relation->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
                                       ^~
                                       =
2 warnings generated.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


В списке pgsql-hackers по дате отправления
От: Sergei Kornilov
Дата:
От: David Steele
Дата:
FAQ