| От | Tom Lane |
|---|---|
| Тема | Re: Out of memory error during updating huge table |
| Дата | |
| Msg-id | 782.1139705013@sss.pgh.pa.us обсуждение |
| Ответ на | Out of memory error during updating huge table (Gabor Siklos <siklosg@yahoo.com>) |
| Список | pgsql-general |
Gabor Siklos <siklosg@yahoo.com> writes:
> I'm trying to update a table in transaction mode with
> 300 million records in it, and I'm getting an out of
> memory error.
The update per se shouldn't be a problem, but if you have AFTER ROW
triggers on the table then the list of pending trigger events could
be a problem. Foreign key constraints, in particular, use AFTER
triggers.
> In transaction mode, I first delete all the records in
> the table and then try to use COPY to populate it
> again with the new data from a file. The out of memory
> error happens during the COPY.
If the problem is coming from an FK constraint, you might consider
dropping the constraint and then re-adding it after the COPY. This'd
probably be faster than checking the rows "retail", too.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера