Re: problem in select - Mailing list pgsql-general

From Nigel J. Andrews
Subject Re: problem in select
Date
Msg-id Pine.LNX.4.21.0209131757570.619-100000@ponder.fairway2k.co.uk
Whole thread Raw
In response to problem in select  ("frank_lupo" <frank_lupo@email.it>)
List 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


pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: problem in select
Next
From: frbn
Date:
Subject: Re: pg_dumpall between Linux and FreeBSD.