On Mon, 17 Feb 2003 11:51:56 +0100, Chantal Ackermann
<chantal.ackermann@biomax.de> 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