Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 998636342B1 for ; Tue, 3 Nov 2009 13:51:33 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 00439-05 for ; Tue, 3 Nov 2009 17:48:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from vexbert.mr-paradox.net (vexbert.mr-paradox.net [198.145.180.174]) by mail.postgresql.org (Postfix) with ESMTP id 2368463311F for ; Tue, 3 Nov 2009 13:47:30 -0400 (AST) Received: by vexbert.mr-paradox.net (Postfix, from userid 18391) id 66C7E8459C; Tue, 3 Nov 2009 12:47:29 -0500 (EST) Date: Tue, 3 Nov 2009 09:47:29 -0800 From: David Kerr To: pgsql-performance@postgresql.org Subject: Optimizer + bind variables Message-ID: <20091103174729.GA55736@mr-paradox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200911/24 X-Sequence-Number: 36192 Does/is it possible for the PG optimizer come up with differnet plans when you're using bind variables vs when you send static values? like if my query was select * from users (add a bunch of complex joins) where username = 'dave' vs select * from users (add a bunch of complex joins) where username = '?' In oracle they are frequently different. if it's possible for the plan to be different how can i generate an xplan for the bind version? Thanks! Dave