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_server_version
Last updated: Fri, 14 Aug 2009

view this page in

oci_set_prefetch

(PHP 5, PECL oci8 >= 1.1.0)

oci_set_prefetchIndique le nombre de lignes qui doivent être lues à l'avance par Oracle

Description

bool oci_set_prefetch ( resource $statement , int $rows )

Spécifie le nombre de lignes à préchargées après un appel avec succès à la fonction oci_execute().

Liste de paramètres

statement

rows

La valeur par défaut est 1.

Valeurs de retour

Cette fonction retourne TRUE en cas de succès, FALSE en cas d'échec.

Notes

Note: Dans les versions de PHP antérieures à la version 5.0.0, vous devez utiliser la fonction ocisetprefetch(). Cet ancien nom est toujours utilisable : un alias a été fait vers la fonction oci_set_prefetch(), pour assurer la compatibilité ascendante. Toutefois, il est recommandé de ne plus l'utiliser.

Voir aussi



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_server_version
Last updated: Fri, 14 Aug 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites