Re: problems doing sub-selects on PostgreSQL 7.1.3 and - Mailing list pgsql-admin

From bpalmer
Subject Re: problems doing sub-selects on PostgreSQL 7.1.3 and
Date
Msg-id Pine.BSO.4.40.0112101732130.12851-100000@mizer.
Whole thread Raw
In response to problems doing sub-selects on PostgreSQL 7.1.3 and Solaris 7  ("Heather Johnson" <hjohnson@nypost.com>)
List pgsql-admin
>     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


pgsql-admin by date:

Previous
From: Mr OCP
Date:
Subject: Please help me write this query or function
Next
From: Anto Prijosoesilo
Date:
Subject: Corrupted DB. Help.