downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

oci_statement_type> <oci_set_module_name
Last updated: Fri, 30 Oct 2009

view this page in

oci_set_prefetch

(PHP 5, PECL oci8 >= 1.1.0)

oci_set_prefetchSets number of rows to be prefetched

Beschreibung

bool oci_set_prefetch ( resource $statement , int $rows )

Sets the number of rows to be prefetched after successful call to oci_execute().

Parameter-Liste

statement

A valid OCI statement identifier.

rows

The number of rows to be prefetched.

Rückgabewerte

Gibt bei Erfolg TRUE zurück, im Fehlerfall FALSE.

Anmerkungen

Hinweis: In PHP versions before 5.0.0 you must use ocisetprefetch() instead. This name still can be used, it was left as alias of oci_set_prefetch() for downwards compatability. This, however, is deprecated and not recommended.

Siehe auch



add a note add a note User Contributed Notes
oci_set_prefetch
bmichael at goldparrot dot com
04-Jan-2003 11:00
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_statement_type> <oci_set_module_name
Last updated: Fri, 30 Oct 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites