Oracle 5.0 Reference Manual page 2254

Table of Contents

Advertisement

Non-blocking, asynchronous
queries
Performance statistics
LOAD LOCAL INFILE respects
the
open_basedir directive
Uses PHP's native memory
management system (e.g.,
follows PHP memory limits)
Return numeric column as
double (COM_QUERY)
Return numeric column as string
(COM_QUERY)
Plugin API
Read/Write splitting for MySQL
Replication
Load Balancing
Fail over
Lazy connections
Query caching
Transparent query manipulations
(E.g., auto-EXPLAIN or
monitoring)
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.
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".
Overview of the MySQL PHP drivers
MySQL native driver
(mysqlnd)
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes, with plugin
Yes, with plugin
Yes, with plugin
Yes, with plugin
Yes, with plugin
Yes, with plugin
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.
2234
MySQL client server library
(libmysqlclient)
No
No
No
No
No
Yes
Limited
No
No
No
No
No
No

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents