Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D673464FE7B for ; Mon, 29 Dec 2008 18:48:13 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 57312-01 for ; Mon, 29 Dec 2008 18:48:06 -0400 (AST) X-Greylist: delayed 00:30:57.188938 by SQLgrey-1.7.6 Received: from smtp12.hushmail.com (smtp12.hushmail.com [65.39.178.135]) by mail.postgresql.org (Postfix) with ESMTP id 8F3D864FE53 for ; Mon, 29 Dec 2008 18:48:06 -0400 (AST) Received: from smtp12.hushmail.com (localhost.localdomain [127.0.0.1]) by smtp12.hushmail.com (Postfix) with SMTP id B6C5C700B8 for ; Mon, 29 Dec 2008 22:17:05 +0000 (UTC) Received: from smtp.hushmail.com (mailserver7.hushmail.com [65.39.178.62]) by smtp12.hushmail.com (Postfix) with ESMTP for ; Mon, 29 Dec 2008 22:17:05 +0000 (UTC) Received: by smtp.hushmail.com (Postfix, from userid 99) id 4464B20040; Mon, 29 Dec 2008 22:17:05 +0000 (UTC) MIME-Version: 1.0 Date: Mon, 29 Dec 2008 14:17:05 -0800 To: pgsql-php@postgresql.org Subject: force re-planning of prepared statements? From: pgdba@hush.com Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="UTF-8" Message-Id: <20081229221705.4464B20040@smtp.hushmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200812/11 X-Sequence-Number: 3945 Hi all, I am experiencing some performance issues that I think are stemming from the PDO prepared statements functions. I have a pretty simple query that runs: - sub-second when issued from the command line (not prepared) - takes 200+ seconds when run from the command line inside a prepared statement (eg. http://www.postgresql.org/docs/8.2/interactive/sql-prepare.html) - takes over 200s when run from our application, within the pdo prepared functions - runs sub-second from our application if I prepend the query with "explain analyze" and looking at the resulting plan, it shows the same plan as when it runs quickly from the command line. postgresql 8.2.11, php 5.2.1 What are my options here? I would like to continue to use bind variables to prevent sql injection, but I'd like to force a plan re- parse for every single query. Any ideas? -- Click to become a massage therapist and work for yourself. http://tagline.hushmail.com/fc/PnY6qxsbda5xAD52Aya1On7VD40YOQA3qlB2S2RuRhpQuc9Grmy1V/