pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Josué Maldonado <josue@lamundial.hn>
Cc: pgsql-performance@postgresql.org
Subject: Re: Join slow on "large" tables
Date: Mon, 7 Jun 2004 16:21:10 -0700
Message-ID: <200406071621.10732.josh@agliodbs.com> (raw)
In-Reply-To: <40C4F66C.8030609@lamundial.hn>
References: <40C4E9EA.7000708@lamundial.hn>
	<200406071531.49207.josh@agliodbs.com>
	<40C4F66C.8030609@lamundial.hn>

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




view thread (9+ messages)  latest in thread

Message-ID: <200406071621.10732.josh@agliodbs.com>
Permalink:  ../200406071621.10732.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200406071621.10732.josh@agliodbs.com

 · 

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: josh@agliodbs.com, josue@lamundial.hn
  Subject: Re: Join slow on "large" tables
  In-Reply-To: <200406071621.10732.josh@agliodbs.com>

* 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