pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steinar H. Gunderson <sgunderson@bigfoot.com>
To: pgsql-performance@postgresql.org
Subject: Re: Query take 101 minutes, help, please
Date: Wed, 7 Sep 2005 18:57:54 +0200
Message-ID: <20050907165754.GA12319@uio.no> (raw)
In-Reply-To: <d20db5e605090709227c2c3596@mail.gmail.com>
References: <d20db5e605090709227c2c3596@mail.gmail.com>

On Wed, Sep 07, 2005 at 12:22:27PM -0400, Christian Compagnon wrote:
> I'm a newbie in postgresql, I've installed it on a Windows XP machine
> ( I can't use linux, it's a company machine ), I'm courious why this
> query takes so long

It sounds like you've set work_mem too low; increasing it might help. Also
try rewriting your query to

  SELECT "Rut Cliente"
  FROM "Internet_Abril"
  WHERE
    "Rut Cliente" NOT IN ( SELECT "Rut Cliente" FROM "Internet_Enero" )
    AND "Rut Cliente" NOT IN ( SELECT "Rut Cliente" FROM "Internet_Febrero" )
    AND "Rut Cliente" NOT IN ( SELECT "Rut Cliente" FROM "Internet_Marzo" )

(I'm not sure how optimized UNION inside an IN/NOT IN is.)

/* Steinar */
-- 
Homepage: http://www.sesse.net/



view thread (5+ messages)  latest in thread

Message-ID: <20050907165754.GA12319@uio.no>
Permalink:  ../20050907165754.GA12319@uio.no/
Also on:    postgresql.org/message-id/20050907165754.GA12319@uio.no

 · 

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: sgunderson@bigfoot.com
  Subject: Re: Query take 101 minutes, help, please
  In-Reply-To: <20050907165754.GA12319@uio.no>

* 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