Re: problemas en postgresql -- ayuda !!!!!!

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: tania gutierrez <tanitamile(at)yahoo(dot)com>
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: problemas en postgresql -- ayuda !!!!!!
Date: 2005-07-29 00:58:49
Message-ID: 20050729005849.GI6807@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

On Thu, Jul 28, 2005 at 07:10:10PM -0500, tania gutierrez wrote:

> EXPLAIN analyze SELECT a.* from prueba.apli a, prueba.usuariop b , prueba.usuariopa c where b.USPO_ID=c.USPO_ID and c.APLI_ID=a.APLI_ID and b.USUA_ID=3939 and b.PORL_ID=1 and c.USPA_ESTADO='V' order by c.USPA_ORDEN;
> -------------------------------------------------------------------------------------------------------------------------------------------------------
> Sort (cost=1360.78..1360.78 rows=1 width=495) (actual time=750.070..750.072 rows=1 loops=1)
> Sort Key: c.uspa_orden
> -> Nested Loop (cost=1338.66..1360.77 rows=1 width=495) (actual time=121.309..749.863 rows=1 loops=1)
> Join Filter: ("outer".apli_id = "inner".apli_id)
> -> Nested Loop (cost=1338.66..1358.96 rows=1 width=33) (actual time=120.890..749.427 rows=1 loops=1)
> Join Filter: ("outer".uspo_id = "inner".uspo_id)
> -> Index Scan using uspo_uk on usuariop b (cost=0.00..8.37 rows=2 width=23) (actual time=0.106..0.119 rows=1 loops=1)
> Index Cond: ((usua_id = 3939::numeric) AND (porl_id = 1::numeric))
> -> Materialize (cost=1338.66..1341.31 rows=265 width=56) (actual time=0.051..621.947 rows=52851 loops=1)
> -> Seq Scan on usuariopa c (cost=0.00..1338.66 rows=265 width=56) (actual time=0.040..423.953 rows=52851 loops=1)
> Filter: (uspa_estado = 'V'::text)
> -> Seq Scan on aplicacion a (cost=0.00..1.36 rows=36 width=485) (actual time=0.024..0.290 rows=36 loops=1)
> Total runtime: 752.680 ms
> (13 filas)

Hummm!!! Haz hecho ANALYZE sobre la tabla usuariopa? La estimacion de
filas difiere en dos ordenes de magnitud de la realidad:

-> Seq Scan on usuariopa c (cost=0.00..1338.66 rows=265 width=56) (actual time=0.040..423.953 rows=52851 loops=1)

Haz un ANALYZE a esa tabla y repite la consulta, a ver si mejora esta
estimacion.

> Puede ser problemas de transaccionalidad en el postmaster y el driver de posgtresql?

No, el problema es que la consulta no se esta ejecutando optimamente.

--
Alvaro Herrera (<alvherre[a]alvh.no-ip.org>)
"XML!" Exclaimed C++. "What are you doing here? You're not a programming
language."
"Tell that to the people who use me," said XML.

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2005-07-29 01:00:03 Re: Backup no toma columnas nuevas .
Previous Message Mario Jiménez Carrasco 2005-07-29 00:37:18 Re: establecer conexion con otro usuario diferente a postgres