If your are using Oracle's OCI libraries, on any project, which PHP does, you can use this limit.
I have done network level testing on the effect of this parameter. It does improved efficiency. Big Time.
Oracle uses SQL*Net as the transport mechanism for data between your connection and the database. That is why you must setup Oracle properly.
This parameter tells SQL*NET to Buffer more results. When SQL*NET (at the server) gets a request for data, it bundles up X rows (1,2,3,1000, etc) for transport. It sends the appropriate SQL*NET headers back to the client, Waits for an ACK then begins sending data in MTU sized chunks (ethernet is something like 1500 bytes and ATM's WANS are around 1000 bytes). The chunk size can also be tuned in SQL*NET, but with much less improvements.
TCP/IP then takes the data across the wire, breaking it up into multiple TCP/IP packets.
Once the exchange is done, the SQL*NET client sends an
ACK back to the SQL*NET Listener (the Oracle Server) and the transaction is complete.
Each round trip, SQL*NET looks up inside the server memory (UGA - user global area) to find the query results. It then grabs the rows necessary to send. If it is one row, versus 1000 rows. The process is the same.
There is much I could tell you on how the Database itself reacts. If you can significantly lessen the amount of round trips you are making... WOW.
For more info on Oracle OCI go to http://otn.oracle.com
oci_set_prefetch
(PHP 5, PECL OCI8 >= 1.1.0)
oci_set_prefetch — プリフェッチする行数を設定する
説明
bool oci_set_prefetch
( resource $statement
, int $rows
)
oci_execute() のコールが成功した後にプリフェッチする行数を設定します。
パラメータ
- statement
-
有効な OCI ステートメント ID。
- rows
-
プリフェッチする行数。
返り値
成功した場合に TRUE を、失敗した場合に FALSE を返します。
注意
注意: PHP バージョン 5.0.0 以前では、代わりに ocisetprefetch() を使用しなければなりません。 まだこの名前を使用することができ、下位互換性のため oci_set_prefetch() への別名として残されていますが、 推奨されません。
oci_set_prefetch
bmichael at goldparrot dot com
04-Jan-2003 11:00
04-Jan-2003 11:00
