Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 668AD9FB1DD for ; Thu, 1 Feb 2007 14:15:03 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 87176-10 for ; Thu, 1 Feb 2007 14:14:59 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by postgresql.org (Postfix) with ESMTP id 2A4039F9F0A for ; Thu, 1 Feb 2007 14:14:58 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so479437ugf for ; Thu, 01 Feb 2007 10:14:57 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jjyMFMZSGrhK4W9IyZjWtEiOUB/BrdPVDQ1yZgMPjRiVbO15islXRhqimGBIY6B2VkQotlKlHi1/rvT2AKqb8nK6Av/Cj4yixGJ2EYa3Nj3TRCIBf0FrSdPap8AKvLMoqyDWaxPSeLFoi3z/pvTt0lTGqKMajJPa9uSiDSt561k= Received: by 10.82.113.6 with SMTP id l6mr817693buc.1170353696626; Thu, 01 Feb 2007 10:14:56 -0800 (PST) Received: by 10.82.190.6 with HTTP; Thu, 1 Feb 2007 10:14:56 -0800 (PST) Message-ID: Date: Thu, 1 Feb 2007 13:14:56 -0500 From: "Michael Artz" To: pgsql-performance@postgresql.org Subject: Re: Subselect query enhancement In-Reply-To: <45C22353.4020902@blackducksoftware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <45C22353.4020902@blackducksoftware.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/5 X-Sequence-Number: 23059 > How about this option: > > SELECT distinct ip_info.* FROM ip_info RIGHT JOIN network_events USING > (ip) RIGHT JOIN host_events USING (ip) WHERE > (network_events.name='blah' OR host_events.name = 'blah') AND > ip_info.ip IS NOT NULL; Nah, that seems to be much much worse. The other queries usually return in 1-2 minutes, this one has been running for 30 minutes and has still not returned -Mike