Re: Out of Memory errors are frustrating as heck! - Mailing list pgsql-performance

From Tom Lane
Subject Re: Out of Memory errors are frustrating as heck!
Date
Msg-id 19198.1555857403@sss.pgh.pa.us
Whole thread Raw
In response to Re: Out of Memory errors are frustrating as heck!  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: Out of Memory errors are frustrating as heck!
Re: Out of Memory errors are frustrating as heck!
List pgsql-performance
Jeff Janes <jeff.janes@gmail.com> writes:
> The growEnabled stuff only prevents infinite loops.  It doesn't prevent
> extreme silliness.

> If a single 32 bit hash value has enough tuples by itself to not fit in
> work_mem, then it will keep splitting until that value is in a batch by
> itself before shutting off

Right, that's the code's intention.  If that's not good enough for this
case, we'll need to understand the details a bit better before we can
design a better(?) heuristic.

I suspect, however, that we might be better off just taking the existence
of the I/O buffers into account somehow while deciding whether it's worth
growing further.  That is, I'm imagining adding a second independent
reason for shutting off growEnabled, along the lines of "increasing
nbatch any further will require an unreasonable amount of buffer memory".
The question then becomes how to define "unreasonable".

            regards, tom lane



pgsql-performance by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Out of Memory errors are frustrating as heck!
Next
From: Tomas Vondra
Date:
Subject: Re: Out of Memory errors are frustrating as heck!