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

Re: Too slow

From: Sabio - PSQL <slopez_pg(at)ceroriesgo(dot)co(dot)cr>
To: PostgreSQL Admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Too slow
Date: 2005-03-22 19:10:08
Message-ID: 42406D90.7090501@ceroriesgo.co.cr (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-performance
WITH: select * from partes where cedula not in (select cedula from sujetos)
Seq Scan on partes  (cost=0.00..168063925339.69 rows=953831 width=109)
  Filter: (NOT (subplan))
  SubPlan
    ->  Seq Scan on sujetos  (cost=0.00..162348.43 rows=5540143 width=15)

WITH: select * from partes where not exists (select cedula from sujetos 
where cedula=partes.cedula)
Seq Scan on partes  (cost=0.00..7373076.94 rows=953831 width=109)
  Filter: (NOT (subplan))
  SubPlan
    ->  Index Scan using sujetos_pkey on sujetos  (cost=0.00..3.84 
rows=1 width=15)
          Index Cond: ((cedula)::text = ($0)::text)

Thomas F. O'Connell wrote:

> Please post the results of that query as run through EXPLAIN ANALYZE.
>
> Also, I'm going to reply to this on pgsql-performance, which is 
> probably where it better belongs.
>
> -tfo
>
> -- 
> Thomas F. O'Connell
> Co-Founder, Information Architect
> Sitening, LLC
> http://www.sitening.com/
> 110 30th Avenue North, Suite 6
> Nashville, TN 37203-6320
> 615-260-0005
>
> On Mar 22, 2005, at 8:23 AM, 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
>
>
>
>



In response to

pgsql-performance by date

Next:From: Tom LaneDate: 2005-03-22 19:14:41
Subject: Re: Too slow
Previous:From: Richard HuxtonDate: 2005-03-22 18:57:35
Subject: Re: CPU 0.1% IOWAIT 99% for decisonnal queries

pgsql-admin by date

Next:From: Chris HooverDate: 2005-03-22 19:13:08
Subject: PostgreSQL, INC. Support
Previous:From: Sabio - PSQLDate: 2005-03-22 18:55:01
Subject: Re: Too slow

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