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