Re: Ayuda con Explain de consulta

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Luis Guevara <luis(dot)a(dot)guevara(at)gmail(dot)com>
Cc: PostgreSQL-foro <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: Ayuda con Explain de consulta
Date: 2007-05-24 20:04:12
Message-ID: 20070524200412.GL4320@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Luis Guevara escribió:

> select a.plem_id
> from planilla_empleado_movimiento a
> left join planilla_empleado b using (plem_id)
> where b.plan_id=388

> QUERY PLAN
> Hash Join (cost=10115.59..195262.73 rows=112620 width=4) (actual time=
> 2205.884..3482.227 rows=138918 loops=1)
> Hash Cond: (a.plem_id = b.plem_id)
> -> Seq Scan on planilla_empleado_movimiento a
> (cost=0.00..159788.89rows=1384689 width=4) (actual time=
> 0.036..2733.052 rows=1384690 loops=1)
> -> Hash (cost=10101.01..10101.01 rows=5829 width=4) (actual time=
> 15.907..15.907 rows=6893 loops=1)
> -> Index Scan using planilla_empleado_idx1 on planilla_empleado b
> (cost=0.00..10101.01 rows=5829 width=4) (actual time=0.098..11.105 rows=6893
> loops=1)
> Index Cond: (plan_id = 388)
> Total runtime: 3522.568 ms

Hay indice en planilla_empleado_movimiento.plem_id?

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message jlcambero 2007-05-25 08:25:04 Normalizar BD
Previous Message Oscar Cano 2007-05-24 18:33:03 Re: longitud y tipo de datos