From: | "Jaime Casanova" <systemguards(at)gmail(dot)com> |
---|---|
To: | "ernesto contreras" <eeljuri(at)gmail(dot)com> |
Cc: | "Lista PostgreSql" <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Re: cómo puedo obligar uso de índices |
Date: | 2006-12-08 05:44:57 |
Message-ID: | c2d9e70e0612072144p465a9383gc1bab702136fcfa5@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
On 12/7/06, ernesto contreras <eeljuri(at)gmail(dot)com> wrote:
> Claro vale
>
> explain analyze SELECT pol.idepol, re.mtolocal as prima_devengada
> FROM poliza as pol, recibo as re
> WHERE pol.idepol IN (SELECT idepol
> FROM part_inter_pol
> WHERE codinter='001225'
> AND indlider='S')
> AND re.idepol = pol.idepol;
>
Imagino que has ejecutado VACUUM ANALYZE o al menos ANALYZE?
aunque el query tal como lo pones no necesita de las 3 tablas:
explain analyze
SELECT re.idepol, re.mtolocal as prima_devengada
FROM recibo as re
WHERE re.idepol IN (SELECT idepol FROM part_inter_pol
WHERE codinter='001225'
AND indlider='S');
--
Atentamente,
Jaime Casanova
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook
From | Date | Subject | |
---|---|---|---|
Next Message | Jaime Casanova | 2006-12-08 05:45:59 | Re: retorno opcional ? |
Previous Message | Oscar Cano | 2006-12-08 05:44:40 | pljava |