Re: Memory Usage - Mailing list pgsql-general

From Tom Lane
Subject Re: Memory Usage
Date
Msg-id 973.976294775@sss.pgh.pa.us
Whole thread Raw
In response to Memory Usage  (Nathan Barnett <nbarnett@centuries.com>)
Responses Re: Memory Usage  (Andrew Nosenko <awn@bcs.zp.ua>)
List pgsql-general
Nathan Barnett <nbarnett@centuries.com> writes:
> UPDATE pages SET createdtime = NOW();

> Is there a reason why this would take up all of the memory??

The now() function invocation leaks memory ... only a dozen or so bytes
per invocation, but that adds up over millions of rows :-(.  In 7.0.*
the memory isn't recovered until end of statement.  7.1 fixes this by
recovering temporary memory after each tuple.

You'll see the same behavior for functions and operators on any
pass-by-reference datatype, not just timestamp.

            regards, tom lane

pgsql-general by date:

Previous
From: Lamar Owen
Date:
Subject: Re: Problems with Mandrake RPM
Next
From: Tom Lane
Date:
Subject: Re: Meaning of EXPLAIN information...?