Re: Join slow on "large" tables

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Josué Maldonado <josue(at)lamundial(dot)hn>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Join slow on "large" tables
Date: 2004-06-07 23:21:10
Message-ID: 200406071621.10732.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Josue'

> dbmund=# explain analyze select * from vkardex where kprocode='1013';
> Nested Loop (cost=0.00..2248.19 rows=403 width=114) (actual
> time=846.318..16030.633 rows=3145 loops=1)
> -> Index Scan using pkd_pcode_idx on pkardex (cost=0.00..806.27
> rows=403 width=72) (actual time=0.054..87.393 rows=3544 loops=1)
> Index Cond: ((pkd_pcode)::text = '1013'::text)
> -> Index Scan using pdc_pk_idx on pmdoc (cost=0.00..3.55 rows=1
> width=50) (actual time=4.482..4.484 rows=1 loops=3544)
> Index Cond: (pmdoc.pdc_pk = "outer".doctofk)
> Total runtime: 16033.807 ms

Huh? It is not at all the same. Your index scan is down to 87ms from
27,000! And the total query is down to 16seconds from 47 seconds. Don't
you consider that an improvement?

--
-Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Josué Maldonado 2004-06-07 23:30:13 Re: Join slow on "large" tables
Previous Message Josué Maldonado 2004-06-07 23:12:44 Re: Join slow on "large" tables