Re: Large Table Updates, causing memory exhaustion. Is a transaction wrapper the answer?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mykarz(at)miyabara(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Large Table Updates, causing memory exhaustion. Is a transaction wrapper the answer?
Date: 2000-12-07 21:20:11
Message-ID: 17251.976224011@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"Michael Miyabara-McCaskey" <mykarz(at)miyabara(dot)com> writes:
> Doing a simple operation to uppercase the records, I keep exhausting the
> memory of the backend.

> The original SQL statement I have been using is
> "UPDATE table_name SET field_1 = UPPER(field_1);"

The problem is that the UPPER() function leaks memory, so if you invoke
it enough times in one statement, you will run out. Transaction or not
makes no difference.

This is fixed for 7.1, but in the meantime the only solution I can offer
is to do conditional updates that only affect a subset of the table per
command. You could wrap a sequence of those in a transaction if you
have a need to prevent other processes from seeing the partially-updated
state of the table, but otherwise a transaction isn't going to help.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Nabil Sayegh 2000-12-07 21:30:14 pg_dump ORDER BY
Previous Message Sterling 2000-12-07 21:18:53 Re: Uninstall Everything.