Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 227562E003C for ; Tue, 6 May 2008 14:38:06 -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 28054-04 for ; Tue, 6 May 2008 14:37:58 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.239]) by developer.postgresql.org (Postfix) with ESMTP id A82192E004B for ; Tue, 6 May 2008 14:38:00 -0300 (ADT) Received: by qb-out-0506.google.com with SMTP id a39so1142334qbd.17 for ; Tue, 06 May 2008 10:37:59 -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=tqwNjqL3jsQv1/+CnbFOx7sHShqP/T3KXpGx4eKN06Y=; b=fWyUAzX1RHUTdPttyiX4uu3cxHIXgyCwdrLbvrrw4rDWZGLnR4DW/ttAqOW+Cl7dHmncmsZ7bR5SKFLn4yDf6bCmhAm2vc05Bxf4YRxPt2S3GY4E3BYNSCNzoQYoDi4cSV/JH7I9UN9JvhNqSoaFIyMXswe2CZweIYChd16KEeU= 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=Trnw5eUio2qBPnv6dGetYwW5+hsJN/je5pYxUTtM7udQv5sMKxZPfsMdfk/I0IagqTgFLMp/0Haq67bhD8TLdVXTQR3nAyBfkk7+ZtqqqRxAj+Kon8X34VM/tD5ToVs0DQTqHliZ6jcLO1qvmVU2URvUpwy5/tMvZAvYWn3GP/8= Received: by 10.114.136.1 with SMTP id j1mr995727wad.152.1210095479162; Tue, 06 May 2008 10:37:59 -0700 (PDT) Received: by 10.114.137.7 with HTTP; Tue, 6 May 2008 10:37:59 -0700 (PDT) Message-ID: Date: Tue, 6 May 2008 11:37:59 -0600 From: "Scott Marlowe" To: Justin Subject: Re: What constitutes a complex query Cc: "Craig James" , pgsql-performance@postgresql.org In-Reply-To: <482093F4.2030801@emproshunts.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48207D26.7050201@emproshunts.com> <482086D3.3070902@emolecules.com> <482093F4.2030801@emproshunts.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/96 X-Sequence-Number: 30064 On Tue, May 6, 2008 at 11:23 AM, Justin wrote: > > > Craig James wrote: > > > Justin wrote: > > > > > This falls under the stupid question and i'm just curious what other > people think what makes a query complex? > > > > > > > There are two kinds: > > > > 1. Hard for Postgres to get the answer. > > > this one Sometimes, postgresql makes a bad choice on simple queries, so it's hard to say what all the ones are that postgresql tends to get wrong. Plus the query planner is under constant improvement thanks to the folks who find poor planner choices and Tom for making the changes.