Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 029802E0088 for ; Tue, 6 May 2008 13:58:47 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 20411-01 for ; Tue, 6 May 2008 13:58:40 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.234]) by developer.postgresql.org (Postfix) with ESMTP id C1E912E0086 for ; Tue, 6 May 2008 13:58:41 -0300 (ADT) Received: by wr-out-0506.google.com with SMTP id 76so193014wra.10 for ; Tue, 06 May 2008 09:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=JSuM6F2i69eoeDhryrRQsQFzyZiEGiT+WFZRyhBCAuo=; b=R90IsdpGbeCMA/BdV244IPVNWVxN5cikKypk3DiOz2w1xUv2IIGWF2jUKuk+ZX1asMB/oWSO8+O6AFdTzoqUn1MgxfvUTq3KZaRs4rtWk/bBMHOPhGT3HIo6bQBpy+3Hp9wzlrfBnsbVmp6EkUW/ITB5TLdXSBxGVod6O+R/EOY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=i3IvBWPS/aFigtncA3vcWJJGkPra8hF1uHFkpoGJrxvIeYpHENb0lWxkiQ5Wf2+8ShJ/quqYfrRjIJGtlCMZDNzwdiq8CQAicYWmHg3V75ENEhlt4S0+f03MWE0z74jSw9Ktg5lOkOMQ77yJtSfyl+Yt5oh90L6f5Xtiffi9TqQ= Received: by 10.140.191.14 with SMTP id o14mr454475rvf.130.1210093120019; Tue, 06 May 2008 09:58:40 -0700 (PDT) Received: by 10.141.85.4 with HTTP; Tue, 6 May 2008 09:58:39 -0700 (PDT) Message-ID: <396486430805060958x31dd63ffu994493f68d8e828f@mail.gmail.com> Date: Tue, 6 May 2008 09:58:39 -0700 From: "Richard Broersma" To: "Scott Marlowe" Subject: Re: What constitutes a complex query Cc: Justin , pgsql-performance@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48207D26.7050201@emproshunts.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/91 X-Sequence-Number: 30059 On Tue, May 6, 2008 at 9:41 AM, Scott Marlowe wrote: > I'd say that the use of correlated subqueries qualifies a query as > complicated. Joining on non-usual pk-fk stuff. the more you're > mashing one set of data against another, and the odder the way you > have to do it, the more complex the query becomes. I would add that data analysis queries that have multiple level of aggregation analysis can be complicated also. For example, in a table of racer times find the average time for each team while only counting teams whom at least have greater than four team members and produce an ordered list displaying the ranking for each team according to their average time. -- Regards, Richard Broersma Jr. Visit the Los Angles PostgreSQL Users Group (LAPUG) http://pugs.postgresql.org/lapug