Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4B93A47624D for ; Wed, 9 Oct 2002 13:10:26 -0400 (EDT) Received: from web13408.mail.yahoo.com (web13408.mail.yahoo.com [216.136.175.66]) by postgresql.org (Postfix) with SMTP id B2408475A9E for ; Wed, 9 Oct 2002 13:10:25 -0400 (EDT) Message-ID: <20021009171021.25211.qmail@web13408.mail.yahoo.com> Received: from [24.73.195.91] by web13408.mail.yahoo.com via HTTP; Wed, 09 Oct 2002 10:10:21 PDT Date: Wed, 9 Oct 2002 10:10:21 -0700 (PDT) From: John Pauley Subject: SELECT statement never completes. To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/125 X-Sequence-Number: 9842 pgsql-sql, We are porting a database from IBM DB2 to PostgreSQL. In several related scripts, there is a SELECT statement that never completes in Postgres but completes in a few seconds using DB2, for example: Table row count: SELECT count(*) FROM tableX; 112671 SELECT count(*) from tableY; 314625 This statement does not complete: SELECT id FROM tableX WHERE id NOT IN (SELECT id FROM tableY); Any suggestions? Thanks __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com