X-Original-To: pgsql-performance@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C7F70474E53 for ; Mon, 17 Feb 2003 11:49:50 -0500 (EST) Received: from email05.aon.at (WARSL402PIP5.highway.telekom.at [195.3.96.79]) by postgresql.org (Postfix) with SMTP id E684B474E42 for ; Mon, 17 Feb 2003 11:49:49 -0500 (EST) Received: (qmail 270662 invoked from network); 17 Feb 2003 16:49:53 -0000 Received: from m155p008.dipool.highway.telekom.at (HELO cantor) ([62.46.9.72]) (envelope-sender ) by qmail5rs.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 17 Feb 2003 16:49:53 -0000 From: Manfred Koizar To: Chantal Ackermann Cc: Josh Berkus , pgsql-performance@postgresql.org Subject: Re: cost and actual time Date: Mon, 17 Feb 2003 17:49:16 +0100 Message-ID: References: <3E50BECC.9090107@biomax.de> In-Reply-To: <3E50BECC.9090107@biomax.de> X-Mailer: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/110 X-Sequence-Number: 1166 On Mon, 17 Feb 2003 11:51:56 +0100, Chantal Ackermann wrote: >the gene_id for 'igg' occurres 110637 times in gene_occurrences, it is >the most frequent. Chantal, could you try EXPLAIN ANALYZE SELECT tmp.disease_name, count(tmp.disease_name) AS cnt FROM (SELECT DISTINCT dd.disease_name, d_o.sentence_id FROM disease d, gene_occurrences g_o, disease_occurrences d_o WHERE g_o.sentence_id=d_o.sentence_id AND g_o.gene_id=4711 AND d.disease_id=d_o.disease_id) AS tmp GROUP BY tmp.disease_name ORDER BY cnt DESC; replacing 4711 by the result of SELECT gene_id FROM gene WHERE gene_name='igg' and show us the plan you get? Servus Manfred