|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-04-01 20:04 UTC] sixd@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 10:00:01 2025 UTC |
Description: ------------ Application server in UK Database server in Frankfurt If I put time logs before and after OCIFetchStatement($stmt,$results) Start Time: 01.04.2009 09:28:40 end time:01.04.2009 09:29:12 Records fetched:1723 30 secs to fetch from Frankfurt database. The same code takes 2 secs from UK dataabse How do I reduce the delay? Reproduce code: --------------- function sql_query ($conn,$sql) { $dt =Date('d.m.Y h:i:s'); $fh2=fopen("$_SESSION[workflow_path]temp\\Logmefuncoci.txt",'a+'); if ($fh2) { fwrite($fh2,"\n 1.Sql Query: $sql \n Start Time:$dt "); } $stmt = OCIParse($conn, $sql); OCISetPrefetch($stmt,4000); OCIExecute($stmt,OCI_DEFAULT); $dt =Date('d.m.Y h:i:s'); if ($fh2) { fwrite($fh2,"\n\n2. OCIExecute end time and record count:$dt\n "); } //$n=OCIFetchStatement($stmt,$results); $dt =Date('d.m.Y h:i:s'); if ($fh2) { fwrite($fh2,"\n\n 3. OCI fetchsatement end time:$dt "); fwrite($fh2,"\n\n 4. Records fetched:$cnt "); } OCIFreeStatement($stmt); Expected result: ---------------- time delay should be reduced Actual result: -------------- takes 30secs in Frakfurt database 2 secs in UK database Same data is being fetched from both the servers