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

Re: consulta se demora mucho mas que antes

From: Miguel <mmiranda(at)123(dot)com(dot)sv>
To: Jaime Casanova <systemguards(at)gmail(dot)com>
Cc: "Javier Aquino H(dot)" <JAquino(at)lexuseditores(dot)com>, pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: consulta se demora mucho mas que antes
Date: 2006-03-31 16:54:53
Message-ID: 442D5EDD.3010308@123.com.sv (view raw or flat)
Thread:
Lists: pgsql-es-ayuda
Jaime Casanova wrote:

>> por que sera que nadie me para bola?
>>
>>hace algunos mails atras te aconseje que cambies de:
>>radius-# and h323disconnecttime::date = '2006-03-29'
>>
>>por:
>>radius-# and h323disconnecttime::date = '2006-03-29'::date
>>
>>    
>>
Bueno, yo si segui tu consejo,  pero con mismos resultados


radius=# explain
radius-# select 'quemados',sum(acctsessiontime)/60 as minutos, 
sum(roundedsessiontime)/60 as redondeados
radius-# from stopacct a inner join pines b on (a.username = b.pin)
where h323callorigin = 'originate'
and h323disconnecttime::date = '2006-03-29'::date
radius-# where h323callorigin = 'originate'
radius-# and h323disconnecttime::date = '2006-03-29'::date
radius-# and idproducto in  (11,40,41);
                                                         QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=393646.90..393646.91 rows=1 width=16)
   ->  Nested Loop  (cost=0.00..393639.84 rows=1411 width=16)
         ->  Seq Scan on stopacct a  (cost=0.00..382461.38 rows=1853 
width=31)
               Filter: (((h323callorigin)::text = 'originate'::text) AND 
((h323disconnecttime)::date = '2006-03-29'::date))
         ->  Index Scan using pines_pkey on pines b  (cost=0.00..6.02 
rows=1 width=13)
               Index Cond: (("outer".username)::text = (b.pin)::text)
               Filter: ((idproducto = 11) OR (idproducto = 40) OR 
(idproducto = 41))
(7 rows)

radius=#

>
>pensandolo bien, para eso el indice deberia estar definido sobre
>h323disconnecttime::date
>
>o me equivoco?
>  
>

Nope, igual ignora el indice.

---
Miguel

In response to

Responses

pgsql-es-ayuda by date

Next:From: Alvaro HerreraDate: 2006-03-31 17:05:08
Subject: Re: consulta se demora mucho mas que antes
Previous:From: Alvaro HerreraDate: 2006-03-31 16:28:01
Subject: Re: memoria usada por postmaster

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