postgresql/src/backend
Tom Lane dc0eb137fe Call set_rel_pathlist_hook before generate_gather_paths, not after.
The previous ordering of these steps satisfied the nominal requirement
that set_rel_pathlist_hook could editorialize on the whole set of Paths
constructed for a base relation.  In practice, though, trying to change
the set of partial paths was impossible.  Adding one didn't work because
(a) it was too late to be included in Gather paths made by the core code,
and (b) calling add_partial_path after generate_gather_paths is unsafe,
because it might try to delete a path it thinks is dominated, but that
is already embedded in some Gather path(s).  Nor could the hook safely
remove partial paths, for the same reason that they might already be
embedded in Gathers.

Better to call extensions first, let them add partial paths as desired,
and then gather.  In v11 and up, we already doubled down on that ordering
by postponing gathering even further for single-relation queries; so even
if the hook wished to editorialize on Gather path construction, it could
not.

Report and patch by KaiGai Kohei.  Back-patch to 9.6 where Gather paths
were added.

Discussion: https://postgr.es/m/CAOP8fzahwpKJRTVVTqo2AE=mDTz_efVzV6Get_0=U3SO+-ha1A@mail.gmail.com
2019-02-09 11:41:09 -05:00
..
access Avoid possible deadlock while locking multiple heap pages. 2019-02-02 08:46:32 +05:30
bootstrap Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
catalog Keep perl style checker happy 2019-02-05 15:18:38 -05:00
commands Restrict the use of temporary namespace in two-phase transactions 2019-01-18 09:21:58 +09:00
executor Fix outdated comment 2019-01-19 09:36:36 +01:00
foreign Abstract logic to allow for multiple kinds of child rels. 2017-04-03 22:41:31 -04:00
lib Rename rbtree.c functions to use "rbt" prefix not "rb" prefix. 2018-11-06 13:25:24 -05:00
libpq Don't set PAM_RHOST for Unix sockets. 2018-11-28 14:15:00 +13:00
main Install Windows crash dump handler before all else. 2017-11-12 14:31:04 -08:00
nodes Add stack depth checks to key recursive functions in backend/nodes/*.c. 2018-12-10 11:12:43 -05:00
optimizer Call set_rel_pathlist_hook before generate_gather_paths, not after. 2019-02-09 11:41:09 -05:00
parser Postpone aggregate checks until after collation is assigned. 2019-01-17 06:25:55 +00:00
po Translation updates 2018-11-05 14:46:40 +01:00
port Pad semaphores to avoid false sharing. 2018-07-25 11:00:53 +12:00
postmaster Fix typos in documentation and for one wait event 2019-01-15 08:47:14 +09:00
regex Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
replication Fix handling of synchronous replication for stopping WAL senders 2018-11-29 09:12:45 +09:00
rewrite Fix set of NLS translation issues 2018-08-21 15:17:38 +09:00
snowball Initial pgindent run with pg_bsd_indent version 2.0. 2017-06-21 14:39:04 -04:00
statistics Fix bogus code for extracting extended-statistics data from syscache. 2018-05-02 12:22:48 -04:00
storage Handle EPIPE more sanely when we close a pipe reading from a program. 2018-11-19 17:02:25 -05:00
tcop Allow UNLISTEN in hot-standby mode. 2019-01-25 21:14:31 -05:00
tsearch Make ts_locale.c's character-type functions cope with UTF-16. 2018-11-03 13:56:10 -04:00
utils Defend against null error message reported by libxml2. 2019-02-08 13:31:04 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Add ICU_CFLAGS to global CPPFLAGS 2017-06-12 15:57:22 -04:00
Makefile Fix make rules that generate multiple output files. 2018-03-23 13:45:38 -04:00
nls.mk Translation updates 2018-05-07 11:59:42 -04:00