note 22500 modified in function.ocisetprefetch by sixd
| From: | sixd@php.net | Date: | Mon, 05 Oct 2009 03:56:16 +0000 |
| Subject: | note 22500 modified in function.ocisetprefetch by sixd | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-161333@lists.php.net to get a copy of this message | ||
By default the OCI fetch calls retrieve one row at a time from the database. This is fine for small
result sets, but you incur A LOT of sql*net/database overhead if you are returning a large result
set.
The solution is to use OCISetPrefetch to grab more than one row at a time from the database into the
internal PHP buffer that holds the rows. The fetches that you perform against the database will
still return one row, just as they did before. You don't have to code any differently. The
next time you do a fetch, PHP doesn't have to ask the database for it, it is simply retrieved
from the local buffer.
Your goal is to set this value to approximately the same size as your average result set. Setting
it too high results in a waste of memory, and setting it to low results in too much database
activity.
By setting this value properly you can achieve dramatic speedups on data rich pages. Experiment
with the values a bit and I am sure you will find the call to be one of the most important OCI
functions you will use.
--was--
By default the OCI fetch calls retrieve one row at a time from the database. This is fine for small
result sets, but you incur A LOT of sql*net/database overhead if you are returning a large result
set.
The solution is to use OCISetPrefetch to grab more than one row at a time from the database into the
internal PHP buffer that holds the rows. The fetches that you perform against the database will
still return one row, just as they did before. You don't have to code any differently. The
next time you do a fetch, PHP doesn't have to ask the database for it, it is simply retrieved
from the local buffer.
Your goal is to set this value to approximately the same size as your average result set. Setting
it too high results in a waste of memory, and setting it to low results in too much database
activity.
By setting this value properly you can achieve dramatic speedups on data rich pages. Experiment
with the values a bit and I am sure you will find the call to be one of the most important OCI
functions you will use.
http://php.net/manual/en/function.ocisetprefetch.php