Received: from ms1.nypost.com ([65.209.114.183]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBBEnHm92287 for ; Tue, 11 Dec 2001 09:49:17 -0500 (EST) (envelope-from hjohnson@nypost.com) Received: from sephie (172.16.11.81) by ms1.nypost.com (Worldmail 1.3.167); 11 Dec 2001 09:49:21 -0500 Message-ID: <01e401c18252$c9449a10$510b10ac@sephie> From: "Heather Johnson" To: "bpalmer" Cc: , "Harry Ford" , "Serge Canizares" , "Marie Musacchio" References: Subject: Re: problems doing sub-selects on PostgreSQL 7.1.3 and Solaris 7 Date: Tue, 11 Dec 2001 09:47:41 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200112/76 X-Sequence-Number: 2799 Thanks Brandon---that's a very good idea. I'd still like to know why my x86 box can handle the less effecient query better than an E-450, but this is what I'll do until I can get my curiosity satisfied. ;) Heather ----- Original Message ----- From: "bpalmer" To: "Heather Johnson" Cc: Sent: Monday, December 10, 2001 5:34 PM Subject: Re: [ADMIN] problems doing sub-selects on PostgreSQL 7.1.3 and Solaris 7 > > SELECT count(*) FROM users WHERE id NOT IN ( SELECT users_id FROM users_demographics ); > > I'm not sure about the difference in speed, but try the following for a > much faster query: > > SELECT count(id) > FROM users > > EXCEPT > > SELECT users_id > FROM users_demographics > > Should be a great deal faster. > > - Brandon > > > > -------------------------------------------------------------------------- -- > c: 646-456-5455 h: 201-798-4983 > b. palmer, bpalmer@crimelabs.net pgp:crimelabs.net/bpalmer.pgp5 >