svn: /phpdoc/en/trunk/reference/mysqlnd/ stats.xml
| From: | Anthony Bedford | Date: | Wed, 21 Oct 2009 13:06:40 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/mysqlnd/ stats.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-5180@lists.php.net to get a copy of this message | ||
abedford Wed, 21 Oct 2009 13:06:40 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=289830
Log:
Added a section on buffered and unbuffered result sets. Fixed a few minor errors.
Changed paths:
U phpdoc/en/trunk/reference/mysqlnd/stats.xml
Modified: phpdoc/en/trunk/reference/mysqlnd/stats.xml
===================================================================
--- phpdoc/en/trunk/reference/mysqlnd/stats.xml 2009-10-21 13:05:38 UTC (rev 289829)
+++ phpdoc/en/trunk/reference/mysqlnd/stats.xml 2009-10-21 13:06:40 UTC (rev 289830)
@@ -105,13 +105,42 @@
resulting in better performance.
</para>
<para>
+ <emphasis role="bold">Buffered and Unbuffered Result Sets</emphasis>
+ </para>
+ <para>
+ Result sets can be buffered or unbuffered. Using default settings,
+ <literal>ext/mysql</literal> and <literal>ext/mysqli</literal> work
+ with buffered result sets for normal (non prepared statement) queries.
+ Buffered result sets are cached on the client. After the query
+ execution all results are fetched from the MySQL Server and stored in
+ a cache on the client. The big advantage of buffered result sets is
+ that they allow the server to free all resources allocated to a result
+ set, once the results have been fetched by the client.
+ </para>
+ <para>
+ Unbuffered result sets on the other hand are kept much longer on the
+ server. If you want to reduce memory consumption on the client, but
+ increase load on the server, use unbuffered results. If you experience
+ a high server load and the figures for unbuffered result sets are
+ high, you should consider moving the load to the clients. Clients
+ typically scale better than servers. <quote>Load</quote> does not only
+ refer to memory buffers - the server also needs to keep other
+ resources open, for example file handles and threads, before a result
+ set can be freed.
+ </para>
+ <para>
+ Prepared Statements use unbuffered result sets by default. However,
+ you can use <function>mysqli_stmt_store_result</function> to enable
+ buffered result sets.
+ </para>
+ <para>
<emphasis role="bold">Statistics returned by MySQL Native
Driver</emphasis>
</para>
<para>
The following tables show a list of statistics returned by the
<function>mysqli_get_client_stats</function>,
- <function>mysqli_get_connections_stats</function> and
+ <function>mysqli_get_connection_stats</function> and
<function>mysqli_get_cache_stats</function> functions.
</para>
<para>
@@ -564,9 +593,9 @@
the number of fetched buffered rows it can mean that the client
application runs queries that cause larger result sets than needed
resulting in rows not read by the client.</entry>
- <entry>Examples of queries that will buffere results:
+ <entry>Examples of queries that will buffer results:
<function>mysqli_query</function>,
- <function>mysqli_store_results</function></entry>
+ <function>mysqli_store_result</function></entry>
</row>
<row>
<entry><literal>rows_fetched_from_client_normal_buffered</literal>,