Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19117 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3729 invoked by uid 1010); 22 Sep 2005 11:26:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 3714 invoked from network); 22 Sep 2005 11:26:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Sep 2005 11:26:02 -0000 X-Host-Fingerprint: 212.112.227.169 ipx11223.ipxserver.de Linux 2.5 (sometimes 2.4) (4) Received: from ([212.112.227.169:38947] helo=ipx11223.ipxserver.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id FB/0A-24510-AC492334 for ; Thu, 22 Sep 2005 07:26:02 -0400 Received: from localhost (localhost [127.0.0.1]) by ipx11223.ipxserver.de (Postfix) with ESMTP id 71448DF0129; Thu, 22 Sep 2005 13:26:14 +0200 (CEST) Received: from ipx11223.ipxserver.de ([127.0.0.1]) by localhost (ipx11223 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 02049-01; Thu, 22 Sep 2005 13:26:11 +0200 (CEST) Received: from [127.0.0.1] (i577B588E.versanet.de [87.123.88.142]) by ipx11223.ipxserver.de (Postfix) with ESMTP id 728AFDF0122; Thu, 22 Sep 2005 13:26:11 +0200 (CEST) Message-ID: <433294C3.1090801@php.net> Date: Thu, 22 Sep 2005 13:25:55 +0200 User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ron Korving Cc: internals@lists.php.net References: <56.98.24510.D3D82334@pb1.pair.com> In-Reply-To: <56.98.24510.D3D82334@pb1.pair.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by somedaemon at backendmedia.com Subject: Re: PDO questions From: lsmith@php.net (Lukas Smith) Ron Korving wrote: > 1) Does unsetting $stmt trigger a closeCursor() as well? I assume so, but > the article doesn't mention it. It only talks about the importance of > calling that method. yes this is done automatically .. > 2) Could it be a good idea (performance wise) and possible in the first > place to maintain a pool of prepared statements? Something like this: This should be done on the RDBMS end. I havent looked at how PDO does this in detail, but it would be nice to get some more control over this. Some RDBMS will pool this automatically, some do not (AFAIK pgsql will always create a new statement instead of returning a handle to an existing statement). There is a reason why you may want more control over this. One of the key aspects of a prepared statement is that you safe time due to not having to build a query plan on every execution. This may bite you however if you prepare a statement and then things change within the database that would make it more feasible to use a new plan. > 3) Wouldn't it be nice if you could do a $stmt->execute("foo", "bar"); > (numeric parameters) instead of $stmt->execute(array("foo", "bar")); ? I think this would severely hurt the extensibility of the API not only for PDO itself, but also for people who want to transparently extend the API. regards, Lukas