Обсуждение: EXPLAIN statement can also apply to SELECT INTO.

Поиск
Список
Период
Сортировка

EXPLAIN statement can also apply to SELECT INTO.

От
jian he
Дата:
hi.

https://www.postgresql.org/docs/current/sql-explain.html
>>>
Any SELECT, INSERT, UPDATE, DELETE, MERGE, VALUES, EXECUTE, DECLARE,
CREATE TABLE AS, or CREATE MATERIALIZED VIEW AS statement, whose
execution plan you wish to see.
>>>

seems you can use it with SELECT INTO.

explain (ANALYZE, BUFFERS, TIMING, VERBOSE ON, BUFFERS ON, WAL ON,SETTINGS ON)
select count(*) as cnt INTO s from tenk1;



Re: EXPLAIN statement can also apply to SELECT INTO.

От
"David G. Johnston"
Дата:
On Monday, August 21, 2023, jian he <jian.universality@gmail.com> wrote:
hi.

https://www.postgresql.org/docs/current/sql-explain.html
>>>
Any SELECT, INSERT, UPDATE, DELETE, MERGE, VALUES, EXECUTE, DECLARE,
CREATE TABLE AS, or CREATE MATERIALIZED VIEW AS statement, whose
execution plan you wish to see.
>>>

seems you can use it with SELECT INTO.

explain (ANALYZE, BUFFERS, TIMING, VERBOSE ON, BUFFERS ON, WAL ON,SETTINGS ON)
select count(*) as cnt INTO s from tenk1;


We try not to encourage such things.  And CTAS is listed.

David J.