X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 1B5CB9DC81A for ; Tue, 27 Dec 2005 14:02:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 62373-05 for ; Tue, 27 Dec 2005 14:02:22 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from correo2.acens.net (correo2.acens.net [217.116.0.34]) by postgresql.org (Postfix) with ESMTP id 498CB9DC80C for ; Tue, 27 Dec 2005 14:02:19 -0400 (AST) Received: (qmail 5277 invoked from network); 27 Dec 2005 18:02:19 -0000 Received: from unknown (HELO albert.sedifa.com) ([83.175.220.10]) (envelope-sender ) by correo2.acens.net (qmail-ldap-1.03) with SMTP for ; 27 Dec 2005 18:02:19 -0000 From: Albert Cervera Areny Organization: Sedifa, S.L. To: pgsql-performance@postgresql.org Subject: Re: Performance problems with 8.1.1 compared to 7.4.7 Date: Tue, 27 Dec 2005 19:02:17 +0100 User-Agent: KMail/1.7.2 References: <200512271709.29185.albert@sedifa.com> <20051227171343.GA70061@winnie.fuhr.org> In-Reply-To: <20051227171343.GA70061@winnie.fuhr.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200512271902.18023.albert@sedifa.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200512/635 X-Sequence-Number: 16456 A Dimarts 27 Desembre 2005 18:13, Michael Fuhr va escriure: > On Tue, Dec 27, 2005 at 05:09:28PM +0100, Albert Cervera Areny wrote: > > However, now we have a query that is much slower with 8.1 compared to > > 7.4. The query lasts 7minutes (all the times we try) with 8.1, keeping > > CPU usage at 93~97% while it lasts 25 seconds in 7.4 the first time goi= ng > > down to 4 seconds the following tries. > > We're not experts at all but we can't see anything strange with the > > differences of EXPLAIN in the queries. Below I paste the query and the > > EXPLAIN output. > > Could you post the EXPLAIN ANALYZE output of the query on both > systems? That'll show how accurate the planner's estimates are. > > Have you run ANALYZE (or VACUUM ANALYZE) on the tables in both > versions? The row count estimates in the 8.1.1 query differ from > those in the 7.4.7 query. Are the two versions using the same data > set? > > Are your configuration settings the same in both versions? You > mentioned increasing work_mem, but what about others like > effective_cache_size, random_page_cost, and shared_buffers? Hey, thank you for your fast response, I found what the problem was. I thought the settings were the same but work_mem was still higher in 7.4,= =20 30Mb, so I increased 8.1 to 30Mb and it worked faster, down to 17 seconds t= he=20 first time, 2.5 seconds for the others.=20 Are there any "rules of thumb" to let a begginer give reasonable values to= =20 these parameters? Not only work_mem, but also random_page_cost, and so on.= =20 Are there any tests one can run to determine "good" values? Thanks a lot! =2D-=20 Albert Cervera Areny Dept. Inform=E0tica Sedifa, S.L. Av. Can Bordoll, 149 08202 - Sabadell (Barcelona) Tel. 93 715 51 11 =46ax. 93 715 51 12 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2E....................... AVISO LEGAL ............................ La presente comunicaci=F3n y sus anexos tiene como destinatario la persona a la que va dirigida, por lo que si usted lo recibe por error debe notificarlo al remitente y eliminarlo de su sistema, no pudiendo utilizarlo, total o parcialmente, para ning=FAn fin. Su contenido puede tener informaci=F3n confidencial o protegida legalmente y =FAnicamente expresa la opini=F3n del remitente. El uso del correo electr=F3nico v=EDa Internet no permite asegurar ni la confidencialidad de los mensajes ni su correcta recepci=F3n. En el caso de que el destinatario no consintiera la utilizaci=F3n del correo electr=F3nico, deber=E1 ponerlo en nuestro conocimiento inmediatamente. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2E.......................... DISCLAIMER ............................. This message and its attachments are intended exclusively for the named addressee. If you receive this message in error, please immediately delete it from your system and notify the sender. You may not use this message or any part of it for any purpose. The message may contain information that is confidential or protected by law, and any opinions expressed are those of the individual sender. Internet e-mail guarantees neither the confidentiality nor the proper receipt of the message sent. If the addressee of this message does not consent to the use of internet e-mail, please inform us inmmediately. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20