Re: [GENERAL] Bad planning data resulting in OOM killing of postgres - Mailing list pgsql-general

From Jeff Janes
Subject Re: [GENERAL] Bad planning data resulting in OOM killing of postgres
Date
Msg-id CAMkU=1xS=HTh0msPkLarYD4aNfL0t+KeuE18dvR6AG8k32mE+A@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL] Bad planning data resulting in OOM killing of postgres  (David Hinkle <hinkle@cipafilter.com>)
Responses Re: [GENERAL] Bad planning data resulting in OOM killing of postgres  (David Hinkle <hinkle@cipafilter.com>)
List pgsql-general
On Mon, Feb 13, 2017 at 11:53 AM, David Hinkle <hinkle@cipafilter.com> wrote:
Thanks guys, here's the information you requested:

psql:postgres@cipafilter = show work_mem;
 work_mem
──────────
 10MB
(1 row)


OK, new theory then.  Do you have triggers on or foreign key constraints to the table you are deleting from?  It queues up each deleted row to go back and fire the trigger or validate the constraint at the end of the statement.  You might need to drop the constraint, or delete in smaller batches by adding some kind of dummy condition to the WHERE clause which you progressively move.

Or select the rows you want to keep into a new table, and then drop the old one, rename the new one, and rebuild any constraints or indexes and other dependencies.  This can be pretty annoying if there a lot of them.

Cheers,

Jeff

pgsql-general by date:

Previous
From: David Hinkle
Date:
Subject: Re: [GENERAL] Bad planning data resulting in OOM killing of postgres
Next
From: David Hinkle
Date:
Subject: Re: [GENERAL] Bad planning data resulting in OOM killing of postgres