| От | Tom Lane |
|---|---|
| Тема | Re: Efficiency of CREATE TABLE AS |
| Дата | |
| Msg-id | 21701.1178690251@sss.pgh.pa.us обсуждение |
| Ответ на | Efficiency of CREATE TABLE AS (Brian Herlihy <btherl@yahoo.com.au>) |
| Список | pgsql-novice |
Brian Herlihy <btherl@yahoo.com.au> writes:
> If I do the following
> CREATE TABLE foo AS SELECT * FROM bar
> and a sequential scan is chosen as the plan (in particular, no
> ordering required), will the rows be written directly into the new
> table?
Yes ... actually, the plan has nothing to do with it.
> I am concerned about the case where there may be many
> gigabytes of data being copied between these two tables. And my
> precise concern is that the data may be stored temporarily before
> being placed in the new table, slowing things down.
No. The computed tuples go to the new table, noplace else. See
intorel_receive() and related code.
regards, tom lane
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера