Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-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

pgsql-performance by date

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

pgsql-admin by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group