Received: from neobis.elma.fr (neobis.elma.fr [213.41.14.131]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eA6HqZs16231 for ; Mon, 6 Nov 2000 12:52:36 -0500 (EST) (envelope-from herve@elma.fr) Received: from elma.fr (unknown [10.0.1.2]) by neobis.elma.fr (Postfix) with ESMTP id 07BF826FC3 for ; Mon, 6 Nov 2000 18:56:11 +0100 (CET) Message-ID: <3A06EFB6.14BF8E19@elma.fr> Date: Mon, 06 Nov 2000 18:51:50 +0100 From: =?iso-8859-1?Q?Herv=E9?= Piedvache Reply-To: herve@elma.fr Organization: Elma =?iso-8859-1?Q?Ing=E9nierie?= Informatique X-Mailer: Mozilla 4.75 [fr] (Win98; U) X-Accept-Language: fr,es-AR MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Timing trouble with GROUP BY PostgreSQL / Oracle ? Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200011/43 X-Sequence-Number: 74 Hi, I would like to know if someone have a solution for me ... I have a table with today about 2,8 millions records. The table have good indexes, in our case on idcond, and points ! When I do : select sum(points) from gains; With Oracle : 8 sec With PostGreSQL : 10 sec OK for this it's ok ... But when I do : select sum(points) from gains group by idcond; With Oracle : 22 sec With PostGreSQL : about 3 minutes !!! I have done a vacuum analyse of the table gains ... just before testing ... What can I do to optimize that result ? Why the group by function is so slow ?? Thanks for your help ! Regards, -- Hervé Piedvache Elma Ingenierie Informatique 6, rue du Faubourg Saint-Honoré F-75008 - Paris - France http://www.elma.fr Tel: +33-1-44949901 Fax: +33-1-44949902 Email: herve@elma.fr