Re: Very slow queries - please help.

From: Guillaume Smet <guillaume(dot)smet(at)openwide(dot)fr>
To: Bealach-na Bo <bealach_na_bo(at)hotmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Very slow queries - please help.
Date: 2005-11-24 15:03:47
Message-ID: 4385D653.7020804@openwide.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi,

> I'm also sending the EXPLAIN outputs.

Please provide EXPLAIN ANALYZE outputs instead of EXPLAIN. You will have
more information.

Indexes on your tables are obviously missing. You should try to add:

CREATE INDEX idx_node_filter ON node(name, type, usage);
CREATE INDEX idx_job_log_filter ON job_log(job_name, job_start, job_stop);

I'm not so sure it's a good idea to add job_stop in this index as you
have an IS NULL in your query so I'm not sure it can be used. You should
try it anyway and remove it if not needed.

I added all your search fields in the indexes but it depends a lot on
the selectivity of your conditions. I don't know your data but I think
you understand the idea.

HTH

--
Guillaume

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2005-11-24 15:15:35 Re: Very slow queries - please help.
Previous Message Bealach-na Bo 2005-11-24 14:36:06 Re: Very slow queries - please help.