Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93116 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21987 invoked from network); 8 May 2016 17:51:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 May 2016 17:51:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:41581] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 67/32-04420-CAC7F275 for ; Sun, 08 May 2016 13:51:41 -0400 Received: by mail.experimentalworks.net (Postfix, from userid 1003) id 6CECC48171; Sun, 8 May 2016 19:51:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on km31408.keymachine.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=4.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.0 X-Spam-HAM-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Received: from [192.168.2.34] (ppp-46-244-173-77.dynamic.mnet-online.de [46.244.173.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id 3DD794816D; Sun, 8 May 2016 19:51:37 +0200 (CEST) Message-ID: <1462729893.13652.28.camel@kuechenschabe> To: Raja Kulasekaran Cc: internals@lists.php.net Date: Sun, 08 May 2016 19:51:33 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] How to get trace of all database queries executed by php From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, On Fri, 2016-05-06 at 19:34 -0400, Raja Kulasekaran wrote: > Is there any php extension available which help me out to give the > statistics of > all the queries execution details ? if you are on a development machine (thus no unrelated traffic) something like a query log (in MySQL general_log) might be the quickest and most simple way. However if you're using MySQL you might also look at pecl.php.ne/mysqlnd_uh which allows to overload low level calls in mysqlnd (thus below PDO or mysqli or so) from userland and adding your own logging logic. See http://php.net/manual/en/mysqlnd-uh.quickstart.query-monitoring.php Maybe you should also check the license agreement of the software you're using. Some people try to disallow that. (I can't tell whether such rules might be relevant and binding) johannes