Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 1A8C2B5DBCB for ; Thu, 27 Oct 2011 04:03:52 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 56911-06 for ; Thu, 27 Oct 2011 07:03:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail.csc.lt (mail.csc.lt [193.138.191.5]) by mail.postgresql.org (Postfix) with ESMTP id 57E85B5D91F for ; Thu, 27 Oct 2011 04:03:44 -0300 (ADT) Received: (qmail 28404 invoked by uid 210); 27 Oct 2011 07:03:32 -0000 Received: from mail.nsoft.lt by mail (envelope-from , uid 201) with qmail-scanner-2.05st (clamdscan: 0.97/13855. spamassassin: 3.2.1. perlscan: 2.05st. Clear:RC:1(77.240.249.53):. Processed in 0.078039 secs); 27 Oct 2011 07:03:32 -0000 Received: from mail.nsoft.lt (77.240.249.53) by mail.csc.lt with SMTP; 27 Oct 2011 07:03:32 -0000 Received: from [192.168.16.113] (unknown [77.240.249.53]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.nsoft.lt (Postfix) with ESMTPS id AC4B98E1D6 for ; Thu, 27 Oct 2011 10:03:30 +0300 (EEST) Message-ID: <4EA90242.5040109@nsoft.lt> Date: Thu, 27 Oct 2011 10:03:30 +0300 From: Julius Tuskenis Organization: UAB nSoft User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Anti join miscalculates row number? References: <000d01cc93c9$5d3a8e90$17afabb0$@reufsteck@staufenbiel.de> In-Reply-To: <000d01cc93c9$5d3a8e90$17afabb0$@reufsteck@staufenbiel.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201110/225 X-Sequence-Number: 45447 Hello, Jens On 2011.10.26 13:23, Jens Reufsteck wrote: > I’ve got a lengthy query, that doesn't finish in reasonable time (i.e. > 10min+). I suspect, that the query optimizer miscalculates the number of > rows for part of the query. > I'm sorry for the silly question, but have you tried analyze on your database or at least the tables involved in the query ? -- Julius Tuskenis Head of the programming department UAB nSoft mob. +37068233050