Re: Query plan: SELECT vs INSERT from same select

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query plan: SELECT vs INSERT from same select
Дата
Msg-id 29965.1563916690@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Query plan: SELECT vs INSERT from same select  (Alexander Voytsekhovskyy <young.inbox@gmail.com>)
Список pgsql-general
Alexander Voytsekhovskyy <young.inbox@gmail.com> writes:
> You can see explain analyze verbose here:
> https://explain.depesz.com/s/AEWj

> The problem is, when i wrap it to

> A)
> INSERT INTO norepl_1542_result (axis_x1, axis_y1, v_1)
> SELECT .... SAME QUERY

> OR even

> B)
> WITH rows AS (
> ... SAME SELECT QUERY ...
> )
> INSERT INTO norepl_1542_result (axis_x1, axis_y1, v_1)
> SELECT * FROM rows

> The query time dramatically drops to 500+ seconds.

> You can see explain analyze verbose here
> https://explain.depesz.com/s/AEWj

That's the same link.

> As you can see, 100% of time goes to same SELECT query, there is no issues
> with INSERT-part

We can't see any such thing from what you posted.

            regards, tom lane



В списке pgsql-general по дате отправления:

Предыдущее
От: Igor Korot
Дата:
Сообщение: Re: Query plan: SELECT vs INSERT from same select
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Query plan: SELECT vs INSERT from same select