X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id DAFC7D1B8B3 for ; Mon, 25 Aug 2003 10:22:21 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 16282-04 for ; Mon, 25 Aug 2003 10:21:54 -0300 (ADT) Received: from localhost.localdomain (unknown [65.217.53.66]) by svr1.postgresql.org (Postfix) with ESMTP id 0388FD1DB0C for ; Mon, 25 Aug 2003 10:21:50 -0300 (ADT) Received: from thorn.mmrd.com (thorn.mmrd.com [172.25.10.100]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id h7PC7lqd029665 for ; Mon, 25 Aug 2003 08:07:47 -0400 Received: from gnvex001.mmrd.com (gnvex001.mmrd.com [192.168.3.55]) by thorn.mmrd.com (8.11.6/8.11.6) with ESMTP id h7PDLqZ26613 for ; Mon, 25 Aug 2003 09:21:54 -0400 Received: from camel.mmrd.com ([172.25.5.213]) by gnvex001.mmrd.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id Q65S2393; Mon, 25 Aug 2003 09:21:51 -0400 Subject: Re: Query to slow From: Robert Treat To: Rhaoni Chiu Pereira Cc: Lista PostgreSQL In-Reply-To: <1061813837.3f49fe4d20844@sistemica.info> References: <1061813837.3f49fe4d20844@sistemica.info> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 25 Aug 2003 09:21:52 -0400 Message-Id: <1061817712.3390.212.camel@camel> Mime-Version: 1.0 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/283 X-Sequence-Number: 10004 On Mon, 2003-08-25 at 08:17, Rhaoni Chiu Pereira wrote: > Hi List, > > As I said before, I'm not a DBA " yet" , but I'm learning ... and I > already have a PostgreSQL running, so I have to ask some help... > I got a SQL as folows : > > > I have created the decode, NVL and DIVIDE functions.... the problem is that the > where condition makes this query to slow ( about 4 min ) and the same query in > my Oracle database takes less than 40 seconds. I have tried to isolate the > problem taking off some fields and I left justa the two first fields in the > query ( ftnfco00.estado_cliente , ftcofi00.grupo_faturamento ) and it still > taking almost 4 min to return. Does anyone have a hint to give me to make it > faster ? > Make sure you have run vacuum analyze on your database, if it is still slow post "explain analyze " to pgsql-performance mailing list Robert Treat -- Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL