Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A687A2E3E89 for ; Mon, 21 Jan 2008 14:04:38 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 30299-02-3 for ; Mon, 21 Jan 2008 14:04:35 -0400 (AST) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by postgresql.org (Postfix) with ESMTP id 106E52E3D4E for ; Mon, 21 Jan 2008 14:04:34 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id f5so272008nfh.23 for ; Mon, 21 Jan 2008 10:04:33 -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=hvyB9fh3HUftSIYjtp7t4ePz9zU+Ot8XtZo1+9rzo9g=; b=riSTKdQ6Edu6j7J0pVd+JPCk1ACqPKtkzG99oGHEh7LZCvK2t94Z389dUqAWhAEv3jB0HXU+1YZ7ULOfhnF+YnBjOWL/E81dZVXH4UILpVvSj1Ay1d6m5x8Dm7hgG1wXfPKf4P4LLU8GnQ/cWpv3MDSyrKIIzCxSrzeZgOnKM10= 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=h4BG09ybQ/18LVa4+ojv5qD1gVHdoKRJgd04qMKzMiJiKXTD85iVco17NdQzSekEnTUvhgEj2tD6DtbWy+Or+uov2WQwvU9cOj78+4zbtbhRNCiweH5eWxlRnK/CY9OT7REpAgrl99GK+ZjLMWheRIWW9GUI4U5+j2OLYhCas8g= Received: by 10.78.172.20 with SMTP id u20mr9613518hue.3.1200938673233; Mon, 21 Jan 2008 10:04:33 -0800 (PST) Received: by 10.78.35.7 with HTTP; Mon, 21 Jan 2008 10:04:33 -0800 (PST) Message-ID: <162867790801211004q3b01f0a3hb97d162392ac037@mail.gmail.com> Date: Mon, 21 Jan 2008 19:04:33 +0100 From: "Pavel Stehule" To: "Tom Lane" , "Bruce Momjian" Subject: Re: Slow performance with left outer join Cc: "Marten Verhoeven" , pgsql-performance@postgresql.org In-Reply-To: <8283.1200934555@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <8283.1200934555@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/161 X-Sequence-Number: 28400 Hello > > Filter: ((COALESCE((at_type)::integer, 1) = 1) AND (COALESCE(at_language, 0::numeric) = 0::numeric)) > > If this is slow, it must be that the scan of fpuarticletext actually > returns many more rows than the single row the planner is expecting. > The reason the estimate is off is probably that the planner cannot make > any useful estimate about those COALESCE expressions. Try rewriting > them in the simpler forms > > (at_type = 1 or at_type is null) AND > (at_language = 0 or at_language is null) > what about put this topic into FAQ. Regards Pavel Stehule