pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Claus Guttesen <kometen@gmail.com>
To: Bealach-na Bo <bealach_na_bo@hotmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Very slow queries - please help.
Date: Thu, 24 Nov 2005 14:23:38 +0100
Message-ID: <b41c75520511240523t3372661fw@mail.gmail.com> (raw)
In-Reply-To: <BAY101-F89F00F81CBAF5B66A6EE0AD540@phx.gbl>
References: <BAY101-F89F00F81CBAF5B66A6EE0AD540@phx.gbl>

> Typical query
> ------------
>
> SELECT n.name
> FROM node n
> WHERE n.name
> LIKE '56x%'
> AND n.type='H'
> AND n.usage='TEST'
> AND n.node_id
> NOT IN
> (select n.node_id
> FROM job_log j
> INNER JOIN node n
> ON j.node_id = n.node_id
> WHERE n.name
> LIKE '56x%'
> AND n.type='H'
> AND n.usage='TEST'
> AND j.job_name = 'COPY FILES'
> AND j.job_start >= '2005-11-14 00:00:00'
> AND (j.job_stop <= '2005-11-22 09:31:10' OR j.job_stop IS NULL))
> ORDER BY n.name

Do you have any indexes?

regards
Claus



view thread (9+ messages)  latest in thread

Message-ID: <b41c75520511240523t3372661fw@mail.gmail.com>
Permalink:  ../b41c75520511240523t3372661fw@mail.gmail.com/
Also on:    postgresql.org/message-id/b41c75520511240523t3372661fw@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: kometen@gmail.com, bealach_na_bo@hotmail.com
  Subject: Re: Very slow queries - please help.
  In-Reply-To: <b41c75520511240523t3372661fw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox