On Fri, 13 Sep 2002, [utf-8] frank_lupo wrote:
> This selection is more fast in ingres vs postgres
> Ingres 6.4 0.04 sec
> Postgres 7.2 0.42 sec
> select titolo,id,anno from ircalend where anno=2002 and id in(select distinct(idcalend) from ircalend_3) order by
anno,titolo
> because ?
What happens if you do:
SELECT titolo,id.anno
FROM ircalend
WHERE
anno = 2002
AND
EXISTS (SELECT 1 FROM ircalend_3 WHERE idcalend = id)
ORDER BY anno, titolo
Try doing an EXPLAIN ANALYZE on your query as well. That will give you the
execution plan.
--
Nigel J. Andrews