[PERFORM] Postgres using more memory than it should

2008-12-03 Thread Matthew Wakeling
Hi. I have a problem on one of our production servers. A fairly complicated query is running, and the backend process is using 30 GB of RAM. The machine only has 32GB, and is understandably swapping like crazy. My colleague is creating swap files as quickly as it can use them up. The

Re: [PERFORM] Postgres using more memory than it should

2008-12-03 Thread Bill Moran
In response to Matthew Wakeling [EMAIL PROTECTED]: Hi. I have a problem on one of our production servers. A fairly complicated query is running, and the backend process is using 30 GB of RAM. The machine only has 32GB, and is understandably swapping like crazy. My colleague is creating

Re: [PERFORM] Postgres using more memory than it should

2008-12-03 Thread tv
Hi. I have a problem on one of our production servers. A fairly complicated query is running, and the backend process is using 30 GB of RAM. The machine only has 32GB, and is understandably swapping like crazy. My colleague is creating swap files as quickly as it can use them up. The

Re: [PERFORM] Postgres using more memory than it should

2008-12-03 Thread Matthew Wakeling
On Wed, 3 Dec 2008, [EMAIL PROTECTED] wrote: Hi. I have a problem on one of our production servers. A fairly complicated query is running, and the backend process is using 30 GB of RAM. The machine only has 32GB, and is understandably swapping like crazy. My colleague is creating swap files as

Re: [PERFORM] Postgres using more memory than it should

2008-12-03 Thread Scott Marlowe
On Wed, Dec 3, 2008 at 9:34 AM, Matthew Wakeling [EMAIL PROTECTED] wrote: On Wed, 3 Dec 2008, [EMAIL PROTECTED] wrote: Hi. I have a problem on one of our production servers. A fairly complicated query is running, and the backend process is using 30 GB of RAM. The machine only has 32GB, and is

Re: [PERFORM] Postgres using more memory than it should

2008-12-03 Thread Matthew Wakeling
On Wed, 3 Dec 2008, Scott Marlowe wrote: Having sent the process a SIGINT and inspected the logs, I now have a query to explain. Looking at it, there is one single sort, and ten hash operations, which would equate to 10GB, not 30GB. What is more worrying is that now that the query has been

Re: [PERFORM] Postgres using more memory than it should

2008-12-03 Thread hubert depesz lubaczewski
On Wed, Dec 03, 2008 at 04:01:48PM +, Matthew Wakeling wrote: The work_mem setting on this machine is 1000MB, running Postgres 8.3.0. Check bug report from 2008-11-28, by Grzegorz Jaskiewicz: query failed, not enough memory on 8.3.5

Re: [PERFORM] Postgres using more memory than it should

2008-12-03 Thread Scott Marlowe
On Wed, Dec 3, 2008 at 9:59 AM, Matthew Wakeling [EMAIL PROTECTED] wrote: On Wed, 3 Dec 2008, Scott Marlowe wrote: Also, you should REALLY update to 8.3.5 as there are some nasty bugs fixed from 8.3.0 you don't want to run into. Who knows, you might be being bitten by one right now. Unlike

[PERFORM] How to profile an SQL script?

2008-12-03 Thread Kynn Jones
Hi. I have a longish collection of SQL statements stored in a file that I run periodically via cron. Running this script takes a bit too long, even for a cron job, and I would like to streamline it. Is there a way to tell Postgres to print out, after each SQL statement is executed, how long it

Re: [PERFORM] How to profile an SQL script?

2008-12-03 Thread Andreas Kretschmer
Kynn Jones [EMAIL PROTECTED] schrieb: Hi. I have a longish collection of SQL statements stored in a file that I run periodically via cron. Running this script takes a bit too long, even for a cron job, and I would like to streamline it. Is there a way to tell Postgres to print out, after

Re: [PERFORM] How to profile an SQL script?

2008-12-03 Thread Heikki Linnakangas
Andreas Kretschmer wrote: Kynn Jones [EMAIL PROTECTED] schrieb: Hi. I have a longish collection of SQL statements stored in a file that I run periodically via cron. Running this script takes a bit too long, even for a cron job, and I would like to streamline it. Is there a way to tell

Re: [PERFORM] How to profile an SQL script?

2008-12-03 Thread Kynn Jones
Andreas, Heikki: Thanks! Kynn