note 57563 modified in function.mysqli-stmt-prepare by danbrown
| From: | danbrown@php.net | Date: | Fri, 28 Nov 2008 22:50:04 +0000 |
| Subject: | note 57563 modified in function.mysqli-stmt-prepare by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-147388@lists.php.net to get a copy of this message | ||
If you select LOBs use the following order of execution or you risk mysqli allocating more memory
that actually used
1)prepare()
2)execute()
3)store_result()
4)bind_result()
If you skip 3) or exchange 3) and 4) then mysqli will allocate memory for the maximal length of the
column which is 255 for tinyblob, 64k for blob(still ok), 16MByte for MEDIUMBLOB - quite a lot and
4G for LONGBLOB (good if you have so much memory). Queries which use this order a bit slower when
there is a LOB but this is the price of not having memory exhaustion in seconds.
--was--
If you select LOBs use the following order of execution or you risk mysqli allocating more memory
that actually used
1)prepare()
2)execute()
3)store_result()
4)bind_result()
If you skip 3) or exchange 3) and 4) then mysqli will allocate memory for the maximal length of the
column which is 255 for tinyblob, 64k for blob(still ok), 16MByte for MEDIUMBLOB - quite a lot and
4G for LONGBLOB (good if you have so much memory). Queries which use this order a bit slower when
there is a LOB but this is the price of not having memory exhaustion in seconds.
http://php.net/manual/en/function.mysqli-stmt-prepare.php