note 104180 rejected from mysqli.get-connection-stats by thiago
| From: | thiago@php.net | Date: | Tue, 31 May 2011 03:39:15 +0000 |
| Subject: | note 104180 rejected from mysqli.get-connection-stats by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-180105@lists.php.net to get a copy of this message | ||
Note Submitter: ulf dot wendel at phpdoc dot de
----
No, the function mysqli_get_connection_stats() and the SQL statements "SHOW SESSION
STATUS" do not return the same.
mysqli_get_connection_stats() collects information at the client, within the PHP mysqlnd library.
The information collected is not related to connection (session) statistics collected by the MySQL
server. Using the SQL statement you can obtain rather server-centric data, such as
"Created_tmp_files", whereas the mysqli_get_connection_stats() call gives rather
client-centric data, such as "explicit_close" and "implicit_close".
The information how many temporary tables have been created is only available at the server. The
information how many PHP MySQL connections had to be closed implicitly by the PHP mysqlnd library is
only available at the client.
mysqli_get_connection_stats() and "SHOW SESSION STATUS" differ in:
- where data is collected
- how data is collected
- what data is collected