Re: problem in select

From: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
To: frank_lupo <frank_lupo(at)email(dot)it>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: problem in select
Date: 2002-09-13 17:01:47
Message-ID: Pine.LNX.4.21.0209131757570.619-100000@ponder.fairway2k.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message frbn 2002-09-13 17:22:22 Re: pg_dumpall between Linux and FreeBSD.
Previous Message Richard Huxton 2002-09-13 16:56:26 Re: problem in select