Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 59B172E02E1 for ; Tue, 11 Dec 2007 02:00:21 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 01059-02-6 for ; Tue, 11 Dec 2007 02:00:12 -0400 (AST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by postgresql.org (Postfix) with ESMTP id 7AA4D2E01B6 for ; Tue, 11 Dec 2007 02:00:13 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id j3so159610ugf.49 for ; Mon, 10 Dec 2007 22:00:12 -0800 (PST) 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=PHdVWozYo+NhIVbSBVxjgdSCrN7VFuXrrl3fFyitUu8=; b=RKyrP7916zlGoiRoZrm9jdeBv215qH0Hy2Mbj1Hjf+zF1Z1r3wh0r/OoR8Ayyx/w5DOaNxU+Lj0jYqu5VsaEe3okpZgxXLdGhrOrd1nX3LY4ZlMEUHBxwW3JKeBa+4IuN1bg2N1FhQQratCtBgq46GJRaSGsfrezz8Xsvn9HF3U= 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=XVngshe2BVTGdGl63S8HWZsBfHI6pLcl29lcJWh9c1Lx4AFT5uIzKSM8oes3iNHwTO6aXNuSnf64PCLTuipDbbYoivqWkai+1Mhx1nQ95VX+qXQQ/ElFyreon9YmkuO7cvH1iV0G3hTYuvI4ja59dSW+Fn2vYloi5NSStWjHevk= Received: by 10.78.122.16 with SMTP id u16mr3912582huc.1197352812186; Mon, 10 Dec 2007 22:00:12 -0800 (PST) Received: by 10.78.35.7 with HTTP; Mon, 10 Dec 2007 22:00:12 -0800 (PST) Message-ID: <162867790712102200m2144573bw7447e0eff6720d55@mail.gmail.com> Date: Tue, 11 Dec 2007 07:00:12 +0100 From: "Pavel Stehule" To: "Gerry Reno" Subject: Re: join on three tables is slow Cc: pgsql-sql@postgresql.org In-Reply-To: <475E111B.6060203@verizon.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <475C96EA.6090002@verizon.net> <475CC478.7010102@Sheeky.Biz> <475E111B.6060203@verizon.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/43 X-Sequence-Number: 29735 On 11/12/2007, Gerry Reno wrote: > Ok, I've been playing around with this SQL some more and I found that if > I remove this: > e.active = '1' > from the query that the query now completes in 5 seconds. Nothing else > has anywhere near the impact of this boolean condition. So what is it > about this boolean field that is causing so much delay? > send execution plan and we can see. Maybe you need a cast on every row, because '1' is varchar. Try e.active = true Pavel > Gerry > > > ---------------------------(end of broadcast)--------------------------- > TIP 7: You can help support the PostgreSQL project by donating at > > http://www.postgresql.org/about/donate >