Re: Too slow

From: "Chris Hoover" <revoohc(at)sermonaudio(dot)com>
To: "Sabio - PSQL" <slopez_pg(at)ceroriesgo(dot)co(dot)cr>
Cc: "PostgreSQL Admin" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Too slow
Date: 2005-03-22 18:49:20
Message-ID: 424068B0.8090101@sermonaudio.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance

Sabio - PSQL wrote:

> How can I improve speed on my queries. For example this query takes
> one day executing itself and it has not finalized !!!
> "create table tmp_partes as select * from partes where identificacion
> not in (select cedula from sujetos)"
>
> partes have 1888000 rows, an index on identificacion
> sujetos have 5500000 rows, an index on cedula
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>
>
try create table tmp_partes as select * from partes where not exists
(select cedula from sujetos where cedula = partes.identificacion);

The "not in (subselect)" is very slow in postgresql.

HTH,

chris

In response to

  • Too slow at 2005-03-22 14:23:07 from Sabio - PSQL

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Thomas F.O'Connell 2005-03-22 18:50:29 Re: [ADMIN] Too slow
Previous Message Lee Wu 2005-03-22 18:44:56 Re: Too slow

Browse pgsql-performance by date

  From Date Subject
Next Message Thomas F.O'Connell 2005-03-22 18:50:29 Re: [ADMIN] Too slow
Previous Message Tom Lane 2005-03-22 18:34:37 Re: What about utility to calculate planner cost constants?