On Wed, Jun 29, 2005 at 09:25:24AM -0400, David Gagnon wrote:
> 
>  I stop the following statement after 3 minutes....
> 
>   explain analyse select *
>        From IC
>        where IC.ICNUM NOT IN (select IRICNUM from IR WHERE IRSTATUT in 
> (1, 2))

What does EXPLAIN without ANALYZE show?  What are the table definitions
and what are the results of the following queries?

SELECT COUNT(*) FROM IC;
SELECT COUNT(*) FROM IR;
SELECT COUNT(*) FROM IR WHERE IRSTATUT IN (1, 2);
SELECT COUNT(DISTINCT IRICNUM) FROM IR WHERE IRSTATUT IN (1, 2);

Have you run VACUUM ANALYZE on the tables?

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Reply via email to