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
обсуждение исходный текст
Ответ на 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  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-hackers
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
comparisonto 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
comparisonto 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
Дата:
Сообщение: Re: replay pause vs. standby promotion
Следующее
От: David Steele
Дата:
Сообщение: Re: Control your disk usage in PG: Introduction to Disk QuotaExtension