From: | Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Fix excessive memory consumption in the new sort pre-reading cod |
Date: | 2016-10-06 06:52:06 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix excessive memory consumption in the new sort pre-reading code.
LogicalTapeRewind() should not allocate large read buffer, if the tape
is completely empty. The calling code relies on that, for its
calculation of how much memory to allocate for the read buffers. That
lead to massive overallocation of memory, if maxTapes was high, but
only a few tapes were actually used.
Reported by Tomas Vondra
Discussion: <7303da46-daf7-9c68-3cc1-9f83235cf37e(at)2ndquadrant(dot)com>
Branch
------
master
Modified Files
--------------
src/backend/utils/sort/logtape.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Heikki Linnakangas | 2016-10-06 10:35:59 | pgsql: Disable synchronous commits in pg_rewind. |
Previous Message | Heikki Linnakangas | 2016-10-06 06:24:05 | Re: pgsql: Change the way pre-reading in external sort's merge phase works. |