Fix EXPLAIN ANALYZE SELECT INTO
authorPavan Deolasee <[email protected]>
Fri, 12 May 2017 12:06:23 +0000 (17:36 +0530)
committerPavan Deolasee <[email protected]>
Fri, 12 May 2017 12:12:18 +0000 (17:42 +0530)
commit802721867a8d3862eb2ebdb64db1faac013354b8
tree619f3dc7a58283ce8e944921627a6945c7ff7d41
parent6dddd57c9a5da1e1192f9455cf5e0a9ad623ea6f
Fix EXPLAIN ANALYZE SELECT INTO

EXPLAIN ANALYZE SELECT INTO was missing the treatment that we give to a regular
SELECT INTO or CREATE TABLE AS SELECT. This patch fixes that such that even
when EXPLAIN ANALYZE is used, we first create the target table and then insert
the selected rows.

The EXPLAIN ANALYZE will only show the plan for the final transformed INSERT
INTO statement. This is not very useful right now the EXPLAIN ANALYZE doesn't
show anything below Remote Subquery Scan, but that's a separate issue and will
be fixed in a separate patch.

The regression test's expected output is updated accordingly.

This will be backpatched to XL9_5_STABLE.
src/backend/commands/explain.c
src/test/regress/expected/select_into.out