Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78122 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32967 invoked from network); 16 Oct 2014 17:59:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Oct 2014 17:59:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=christopher.jones@oracle.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=christopher.jones@oracle.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain oracle.com designates 156.151.31.81 as permitted sender) X-PHP-List-Original-Sender: christopher.jones@oracle.com X-Host-Fingerprint: 156.151.31.81 userp1040.oracle.com Received: from [156.151.31.81] ([156.151.31.81:32227] helo=userp1040.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 05/48-11594-D6700445 for ; Thu, 16 Oct 2014 13:59:10 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s9GHx4YR021293 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 16 Oct 2014 17:59:05 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s9GHx2aE005095 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 16 Oct 2014 17:59:03 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s9GHx2kl000074; Thu, 16 Oct 2014 17:59:02 GMT Received: from [144.25.174.186] (/144.25.174.186) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 16 Oct 2014 10:59:02 -0700 Message-ID: <54400765.90802@oracle.com> Date: Thu, 16 Oct 2014 10:59:01 -0700 Organization: Oracle Corporation User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Rasmus Lerdorf CC: PHP Internals , Morgan Tocker References: <543FE883.2070401@lerdorf.com> In-Reply-To: <543FE883.2070401@lerdorf.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: acsinet21.oracle.com [141.146.126.237] Subject: Re: [PHP-DEV] [PATCH - PR] Disable ATTR_EMULATE_PREPARES by default for PDO_Mysql From: christopher.jones@oracle.com (christopher jones) On 10/16/14, 8:47 AM, Rasmus Lerdorf wrote: > On 10/16/2014 04:27 AM, Ferenc Kovacs wrote: >> On Fri, Jun 15, 2012 at 3:01 AM, Anthony Ferrara >> wrote: >> >>> Hello all, >>> >>> I raised this topic on list over a year ago ( >>> http://marc.info/?l=php-internals&m=130417646507744&w=2 ). It was >>> determined that it wasn't time yet to disable prepared statement >>> emulation for MySQL yet. However, Rasmus did mention that it was a >>> possibility for 5.4 ( >>> http://marc.info/?l=php-internals&m=130418875017027&w=2 ). Since that >>> ship has sailed, I submitted a pull request for trunk to change the >>> default value of prepared statement emulation for MySQL. >>> >>> https://github.com/php/php-src/pull/108 >>> >>> https://bugs.php.net/bug.php?id=54638 >>> >>> Does this need to be an RFC (should I draft one)? Or can it just be >>> pulled as-is? >>> >>> Thanks, >>> >>> Anthony >>> >>> -- >>> PHP Internals - PHP Runtime Development Mailing List >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> >> hi, >> >> do we want to change the default for this in PHP7? > > Honestly, I am not sure about this anymore. There is a significant > performance benefit in doing client-side prepares. Last year I attempted > to switch to server-side prepares on Etsy's production servers but it > added 30-40ms of page latency because of the extra round trips. And yes, > we were doing too many queries, but I fear if we change this default > people won't understand where this slowdown is coming from. > > Of course, in some rare cases using server-side prepares might speed > things up because of prepared statement caching in the server, but I > have yet to see a case where that caching outweighs the extra tcp > roundtrip overhead. > > I do agree that the default should probably be server-side since it is > the least surprising. We just need to make it very very clear in the > upgrade doc that this change will likely slow down peoples' apps and > show them how to turn client-side prepares back on. > > -Rasmus > The MySQL team has been improving their server-side prepare code: http://mysqlserverteam.com/re-factoring-some-internals-of-prepared-statements-in-5-7/ Chris -- christopher.jones@oracle.com http://twitter.com/ghrd