Unix Technical Forum

BUG #2422: Memory leak from Savepoints when using foreign keys

This is a discussion on BUG #2422: Memory leak from Savepoints when using foreign keys within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2422 Logged by: Tim Baumgartner Email address: jongleur0815@gmx.de PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 10:58 AM
Tim Baumgartner
 
Posts: n/a
Default BUG #2422: Memory leak from Savepoints when using foreign keys


The following bug has been logged online:

Bug reference: 2422
Logged by: Tim Baumgartner
Email address: jongleur0815@gmx.de
PostgreSQL version: 8.1.3
Operating system: 1. Win2000, 2. Suse 10.0, x86_64-unknown-linux-gnu,
compiled by GCC 4.0.2 20050901 (prerelease)
Description: Memory leak from Savepoints when using foreign keys
Details:

I noticed a memory leak during a long transaction with many savepoints. When
trying to build a short self-contained test case for it, I noticed that the
existence of foreign keys dramatically increases the problem.
When I run the statements below, memory usage of the server process
increases by about 1 MB per second.

BEGIN;
CREATE TABLE t1(pk INT PRIMARY KEY);
CREATE TABLE t2(fk INT, FOREIGN KEY(fk)
REFERENCES t1(pk));
INSERT INTO t1 VALUES(1);
// loop
SAVEPOINT x;
INSERT INTO t2 VALUES(1);
RELEASE x;
// end of loop
COMMIT;

Note:
If the first INSERT statement is repeated in the loop (the loop counter can
be used as the value), then the effect is even higher: about 3 MB per second
on my machine.

Thanks a lot for your fine work anyway!

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:53 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com