Re: [GENERAL] Expensive query - Mailing list pgsql-general

From dustin sallings
Subject Re: [GENERAL] Expensive query
Date
Msg-id Pine.NEB.4.02.9810302101230.1221-100000@dhcp-199.west.spy.net
Whole thread Raw
In response to Re: [GENERAL] Expensive query  (Christophe Pettus <pettus@postdirect.com>)
List pgsql-general
On Fri, 30 Oct 1998, Christophe Pettus wrote:

// At 02:13 PM 10/30/98 , you wrote:
// >    That users table looks kinda useless.  I'd recommend changing id
// >to name and making id an int, then putting your events users in as ints.
// >Currently, it doesn't do anything at all, and you might as well be doing
// >this query [...]
//
// Actually, the real-life 'users' table has lots of fields, none of
// them relevant to the question at hand.

    Right, the point was the table you were using in the query the way
you were using it in the query wouldn't do anything but slow down the
query at best.  You were doing three queries with no chance of the
optimizer doing its job.  Also using ``is not in'' on those search results
just sounds like it'd be horribly slow when you could just ask the whole
thing in one query.

--
SA, beyond.com                            The world is watching America,
pub  1024/3CAE01D5 1994/11/03 Dustin Sallings <dustin@spy.net>
|    Key fingerprint =  87 02 57 08 02 D0 DA D6  C8 0F 3E 65 51 98 D8 BE
L________________________________________ and America is watching TV. __


pgsql-general by date:

Previous
From: Mike Meyer
Date:
Subject: Re: [GENERAL] Problem with aggregates and group by
Next
From: Troy Hanson
Date:
Subject: SCO Unix 3.2 support?