Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id BE6939FA07C for ; Fri, 2 Nov 2007 13:41:08 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 79988-06-4 for ; Fri, 2 Nov 2007 13:41:05 -0300 (ADT) X-Greylist: delayed 01:55:44.967646 by SQLgrey-1.7.5 Received: from tomts19-srv.bellnexxia.net (tomts19.bellnexxia.net [209.226.175.73]) by postgresql.org (Postfix) with ESMTP id 576BD9FA080 for ; Fri, 2 Nov 2007 13:41:04 -0300 (ADT) Received: from toip6.srvr.bell.ca ([209.226.175.125]) by tomts43-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20071102144518.HCJJ26794.tomts43-srv.bellnexxia.net@toip6.srvr.bell.ca> for ; Fri, 2 Nov 2007 10:45:18 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CANfUKkdGNEEJ/2dsb2JhbACCc41E Received: from bas3-montreal45-1177829641.dsl.bell.ca (HELO serenity) ([70.52.65.9]) by toip6.srvr.bell.ca with ESMTP; 02 Nov 2007 10:43:18 -0400 From: "Carlo Stonebanks" To: "'Scott Marlowe'" Cc: References: In-Reply-To: Subject: Re: How to avoid hashjoin and mergejoin Date: Fri, 2 Nov 2007 10:46:11 -0400 Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0085_01C81D3D.955F9920" X-Mailer: Microsoft Office Outlook 11 Thread-Index: Acgcz5aRmEXQaJuTQXuo0FXluyiD+QAjeRjg X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16545 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/127 X-Sequence-Number: 27542 This is a multi-part message in MIME format. ------=_NextPart_000_0085_01C81D3D.955F9920 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Larry, Considering these recommendations, let's try setting shared_buffers to 2GB and work_mem to 16MB. The thing is that work_mem is per connection, and if we get too aggressive and we get a lot of simultaneous users, we can potentially eat up a lot of memory. So 2GB + (100 * 16MB) = 3.6GB total RAM eaten up under peak load for these two values alone. If we wanted to get more aggressive, we can raise work_mem. Carlo -----Original Message----- From: Scott Marlowe [mailto:scott.marlowe@gmail.com] Sent: November 1, 2007 5:39 PM To: Carlo Stonebanks Cc: pgsql-performance@postgresql.org Subject: Re: [PERFORM] How to avoid hashjoin and mergejoin On 11/1/07, Carlo Stonebanks wrote: > I am comparing the same query on two different PG 8.2 servers, one Linux > (8GB RAM) and one Windows (32GB RAM). Both have similar drives and CPU's. > > The Windows posgrestsql.config is pretty well tuned but it looks like > someone had wiped out the Linux config so the default one was re-installed. > All performance-related memory allocation values seem to be set to the > defaults, but mods have been made: max_connections = 100 and shared_buffers > = 32MB. > > The performance for this query is terrible on the Linux server, and good on > the Windows server - presumably because the original Linux PG config has > been lost. This query requires: that "set enable_seqscan to 'off';" Have you run analyze on the server yet? A few general points on performance tuning. With 8.2 you should set shared_buffers to a pretty big chunk of memory on linux, up to 25% or so. That means 32 Meg shared buffers is REAL low for a linux server. Try running anywhere from 512Meg up to 1Gig for starters and see if that helps too. Also turn up work_mem to something like 16 to 32 meg then restart the server after making these changes. Then give us the explain analyze output with all the enable_xxx set to ON. summary: analyze, increase shared_buffers and work_mem, give us explain analyze. ------=_NextPart_000_0085_01C81D3D.955F9920 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Larry,=

 =

Considering = these recommendations, let's try setting shared_buffers to 2GB and work_mem to = 16MB. The thing is that work_mem is per connection, and if we get too aggressive = and we get a lot of simultaneous users, we can potentially eat up a lot of = memory.

 =

So 2GB + (100 * = 16MB) =3D 3.6GB total RAM eaten up under peak load for these two values = alone.

 =

If we wanted to = get more aggressive, we can raise work_mem.

 =

Carlo<= /span>

 

-----Original Message-----
From: Scott Marlowe [mailto:scott.marlowe@gmail.com]
Sent: November 1, 2007 5:39 PM
To: Carlo Stonebanks
Cc: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] How to avoid hashjoin and = mergejoin

 

On 11/1/07, Carlo Stonebanks = <stonec.register@sympatico.ca> wrote:

> I am comparing the same query on two different PG 8.2 = servers, one Linux

> (8GB RAM) and one Windows (32GB RAM). Both have similar = drives and CPU's.

> 

> The Windows posgrestsql.config is pretty well tuned but it = looks like

> someone had wiped out the Linux config so the default one = was re-installed.

> All performance-related memory allocation values seem to be = set to the

> defaults, but mods have been made: max_connections =3D 100 = and shared_buffers

> =3D 32MB.

> 

> The performance for this query is terrible on the Linux = server, and good on

> the Windows server - presumably because the original Linux = PG config has

> been lost. This query requires: that "set = enable_seqscan to 'off';"

 

Have you run analyze on the server = yet?

 

A few general points on performance tuning.  With 8.2 you = should set

shared_buffers to a pretty big chunk of memory on linux, up to = 25% or

so.  That means 32 Meg shared buffers is REAL low for a = linux server.

Try running anywhere from 512Meg up to 1Gig for starters and see = if

that helps too.  Also turn up work_mem to something like 16 = to 32 meg

then restart the server after making these = changes.

 

Then give us the explain analyze output with all the enable_xxx = set to ON.

 

summary: analyze, increase shared_buffers and work_mem, give us = explain analyze.

------=_NextPart_000_0085_01C81D3D.955F9920--