Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 3B1B21337B4E for ; Tue, 1 Mar 2011 05:41:08 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 97109-05 for ; Tue, 1 Mar 2011 09:41:02 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from elizabeth.gransy.com (elizabeth.gransy.com [89.187.132.199]) by mail.postgresql.org (Postfix) with ESMTP id D010B133616B for ; Tue, 1 Mar 2011 05:41:00 -0400 (AST) Received: from sq.gransy.com (localhost [127.0.0.1]) by elizabeth.gransy.com (Postfix) with ESMTP id B913015E435D; Tue, 1 Mar 2011 10:40:59 +0100 (CET) Received: from 85.161.199.242 (SquirrelMail authenticated user tv@fuzzy.cz) by sq.gransy.com with HTTP; Tue, 1 Mar 2011 10:40:59 +0100 Message-ID: In-Reply-To: References: Date: Tue, 1 Mar 2011 10:40:59 +0100 Subject: Re: Two different execution plans for similar requests From: tv@fuzzy.cz To: "Joby Joba" Cc: tv@fuzzy.cz, pgsql-performance@postgresql.org User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal 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: 201103/6 X-Sequence-Number: 42685 > I've already used an 'EXPLAIN ANALYZE' to post the message. So I don't > clearly understand what you are expecting for, when you tell me to provide > 'EXPLAIN ANALYZE' (please excuse me for the misunderstood) No, you haven't. You've provided 'EXPLAIN' output, but that just prepares an execution plan and displays it. So it shows just estimates of row counts etc. and not actual values. Do the same thing but use 'EXPLAIN ANALYZE' instead of 'EXPLAIN' - it will run the query and provide more details about it (run time for each node, actual number of rows etc.). Anyway the sudden changes of estimated costs are suspicious ... Tomas