Overview of the MySQL PHP drivers
2234
MySQL native driver
(
mysqlnd
)
MySQL client server library
(
libmysqlclient
)
Non-blocking, asynchronous
queries
Yes
No
Performance statistics
Yes
No
LOAD LOCAL INFILE respects
the
open_basedir directive
Yes
No
Uses PHP's native memory
management system (e.g.,
follows PHP memory limits)
Yes
No
Return numeric column as
double (COM_QUERY)
Yes
No
Return numeric column as string
(COM_QUERY)
Yes
Yes
Plugin API
Yes
Limited
Read/Write splitting for MySQL
Replication
Yes, with plugin
No
Load Balancing
Yes, with plugin
No
Fail over
Yes, with plugin
No
Lazy connections
Yes, with plugin
No
Query caching
Yes, with plugin
No
Transparent query manipulations
(E.g., auto-EXPLAIN or
monitoring)
Yes, with plugin
No
20.7.1.5. Concepts
Copyright 1997-2012 the PHP Documentation Group. [2230]
These concepts are specific to the MySQL drivers for PHP.
20.7.1.5.1. Buffered and Unbuffered queries
Copyright 1997-2012 the PHP Documentation Group. [2230]
Queries are using the buffered mode by default. This means that query results are immediately
transferred from the MySQL Server to PHP in is then kept in the memory of the PHP process. This
allows additional operations like counting the number of rows, and moving (seeking) the current result
pointer. It also allows issuing further queries on the same connection while working on the result set.
The downside of the buffered mode is that larger result sets might require quite a lot memory. The
memory will be kept occupied till all references to the result set are unset or the result set was explicitly
freed, which will automatically happen during request end the latest. The terminology "store result" is
also used for buffered mode, as the whole result set is stored at once.
Note
When using libmysqlclient as library PHP's memory limit won't count the
memory used for result sets unless the data is fetched into PHP variables. With
mysqlnd the memory accounted for will include the full result set.
Unbuffered MySQL queries execute the query and then return a resource while the data is still waiting
on the MySQL server for being fetched. This uses less memory on the PHP-side, but can increase the
load on the server. Unless the full result set was fetched from the server no further queries can be sent
over the same connection. Unbuffered queries can also be referred to as "use result".
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...