Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 13EF51337B8A for ; Mon, 17 Jan 2011 09:30:06 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 05102-10 for ; Mon, 17 Jan 2011 13:29:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx3.uci.cu (mx3.uci.cu [200.55.140.180]) by mail.postgresql.org (Postfix) with SMTP id 90B1D1337B83 for ; Mon, 17 Jan 2011 09:29:55 -0400 (AST) Received: (qmail 32075 invoked by uid 507); 17 Jan 2011 13:29:45 -0000 Received: from 10.0.0.185 by ns3.uci.cu (envelope-from , uid 501) with qmail-scanner-2.01st (avp: 5.0.2.0. avp: 3.0. avp: 3.0. spamassassin: 3.0.6. perlscan: 2.01st. Clear:RC:1(10.0.0.185):. Processed in 0.786349 secs); 17 Jan 2011 13:29:45 -0000 Received: from unknown (HELO ucimail4.uci.cu) (10.0.0.185) by 0 with SMTP; 17 Jan 2011 13:29:44 -0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by ucimail4.uci.cu (Postfix) with ESMTP id 22895132492D; Mon, 17 Jan 2011 08:37:38 -0500 (CST) X-Virus-Scanned: amavisd-new at uci.cu Received: from ucimail4.uci.cu ([127.0.0.1]) by localhost (ucimail4.uci.cu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5isAxg5cVcGB; Mon, 17 Jan 2011 08:37:35 -0500 (CST) Received: from ucimail4.uci.cu (ucimail4.uci.cu [10.0.0.185]) by ucimail4.uci.cu (Postfix) with ESMTP id 1A0A2132490C; Mon, 17 Jan 2011 08:37:35 -0500 (CST) Date: Mon, 17 Jan 2011 08:37:35 -0500 (CST) From: "Ing. Marcos Ortiz Valmaseda" To: Jeremy Palmer Cc: pgsql-performance@postgresql.org, Andy Colson Message-ID: <999618401.47865491295271455031.JavaMail.root@ucimail4.uci.cu> In-Reply-To: <2074795588.47864911295271390356.JavaMail.root@ucimail4.uci.cu> Subject: Re: Possible to improve query plan? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.0.0.186] X-Mailer: Zimbra 5.0.16_GA_2921.RHEL5_64 (ZimbraWebClient - FF3.0 (Win)/5.0.16_GA_2921.RHEL5_64) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/129 X-Sequence-Number: 41916 Which is the type of your application? You can see it on the Performance Wh= ackamole Presentation from Josh Berkus on the=20 PgCon 2009: - Web application - Online Transaction Processing (OLTP) - Data WareHousing (DW) And based on the type of your application, you can configure the postgresql= .conf to gain a better performance of your PostgreSQL server. PostgreSQL postgresql.conf baseline: shared_buffers =3D 25% RAM work_mem =3D 512K[W] 2 MB[O] 128 MB[D] - but no more that RAM/no_connections maintenance_work_mem =3D 1/16 RAM checkpoint_segments =3D 8 [W], 16-64 [O], [D] wal_buffer =3D 1 MB [W], 8 MB [O], [D] effective_cache_size =3D 2/3 RAM Regards =20 Ing. Marcos Lu=C3=ADs Ort=C3=ADz Valmaseda Linux User # 418229 && PostgreSQL DBA Centro de Tecnolog=C3=ADas Gesti=C3=B3n de Datos (DATEC) http://postgresql.uci.cu http://www.postgresql.org http://it.toolbox.com/blogs/sql-apprentice ----- Mensaje original ----- De: "Jeremy Palmer" Para: "Andy Colson" CC: pgsql-performance@postgresql.org Enviados: Lunes, 17 de Enero 2011 0:13:25 GMT -05:00 Regi=C3=B3n oriental E= E. UU./Canad=C3=A1 Asunto: Re: [PERFORM] Possible to improve query plan? Hi Andy, Yes important omissions: Server version: 8.4.6 OS Windows Server 2003 Standard Ed :( The work mem is 50mb. I tried setting the work_mem to 500mb, but it didn't make a huge difference= in query execution time. But then again the OS disk caching is probably ta= king over here. Ok here's the new plan with work_mem =3D 50mb: http://explain.depesz.com/s/xwv And here another plan with work_mem =3D 500mb: http://explain.depesz.com/s/VmO Thanks, Jeremy -----Original Message----- From: Andy Colson [mailto:andy@squeakycode.net]=20 Sent: Monday, 17 January 2011 5:57 p.m. To: Jeremy Palmer Cc: pgsql-performance@postgresql.org Subject: Re: [PERFORM] Possible to improve query plan? Hum.. yeah it looks like it takes no time at all to pull data from the indi= vidual indexes, and them bitmap them. I'm not sure what the bitmap heap sc= an is, or why its slow. Hopefully someone smarter will come along. Also its weird that explain.depesz.com didnt parse and show your entire pla= n. Hum.. you seem to have ending quotes on some of the lines? One other though: quicksort Memory: 23960kB It needs 20Meg to sort... It could be your sort is swapping to disk. What sort of PG version is this? What are you using for work_mem? (you could try to bump it up a little (it= s possible to set for session only, no need for server restart) and see if = that'd help. And sorry, but its my bedtime, good luck though. -Andy ___________________________________________________________________________= ___________________________ This message contains information, which is confidential and may be subject= to legal privilege.=20 If you are not the intended recipient, you must not peruse, use, disseminat= e, distribute or copy this message. If you have received this message in error, please notify us immediately (P= hone 0800 665 463 or info@linz.govt.nz) and destroy the original message. LINZ accepts no responsibility for changes to this email, or for any attach= ments, after its transmission from LINZ. Thank you. ___________________________________________________________________________= ___________________________ --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance