Bug #68548 [NEW]: slow calls to mysqli_fetch_field when using MYSQLI_STORE_RESULT_COPY_DATA

From: Date: Fri, 05 Dec 2014 04:15:43 +0000
Subject: Bug #68548 [NEW]: slow calls to mysqli_fetch_field when using MYSQLI_STORE_RESULT_COPY_DATA
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-188923@lists.php.net to get a copy of this message
From: ryan dot brothers at gmail dot com Operating system: Linux PHP version: 5.6.3 Package: MySQLi related Bug Type: Bug Bug description:slow calls to mysqli_fetch_field when using MYSQLI_STORE_RESULT_COPY_DATA Description: ------------ I am seeing an issue where calls to mysqli_fetch_field() are very slow when using MYSQLI_STORE_RESULT_COPY_DATA. In the below example, the call to fetch_field takes 5 seconds to run. If the below is changed to call store_result() without MYSQLI_STORE_RESULT_COPY_DATA, then the call to fetch_field takes 0.006 seconds to run. Is there a way that the time to call fetch_field could be improved when using MYSQLI_STORE_RESULT_COPY_DATA? I have placed SQL to create a test table of 100,000 rows at https://drive.google.com/uc?export=download&id=0B37DKbJklxg_Y3NadnRjc2tVbE0. Thanks for your help. Test script: --------------- <?php $mysqli = new mysqli('localhost', 'test', 'test', 'test'); $mysqli->real_query("SELECT * FROM a"); $result = $mysqli->store_result(MYSQLI_STORE_RESULT_COPY_DATA); $start = microtime(true); $field = $result->fetch_field(); echo microtime(true) - $start."\n"; exit; Expected result: ---------------- 0.0065169334411621 Actual result: -------------- 5.0267069339752 -- Edit bug report at https://bugs.php.net/bug.php?id=68548&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68548&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68548&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68548&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=68548&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=68548&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=68548&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=68548&r=needscript Try newer version: https://bugs.php.net/fix.php?id=68548&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=68548&r=support Expected behavior: https://bugs.php.net/fix.php?id=68548&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=68548&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=68548&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=68548&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68548&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=68548&r=dst IIS Stability: https://bugs.php.net/fix.php?id=68548&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=68548&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=68548&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=68548&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=68548&r=mysqlcfg

« previous php.bugs (#188923) next »