Bug #68548 [Fbk->NoF]: slow calls to mysqli_fetch_field when using MYSQLI_STORE_RESULT_COPY_DATA
| From: | php-bugs at lists dot php dot net | Date: | Sun, 22 Mar 2020 04:22:09 +0000 |
| Subject: | Bug #68548 [Fbk->NoF]: slow calls to mysqli_fetch_field when using MYSQLI_STORE_RESULT_COPY_DATA | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-226209@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68548&edit=1
ID: 68548
Updated by: php-bugs@lists.php.net
Reported by: ryan dot brothers at gmail dot com
Summary: slow calls to mysqli_fetch_field when using
MYSQLI_STORE_RESULT_COPY_DATA
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: MySQLi related
Operating System: Linux
PHP Version: 5.6.3
Assigned To: cmb
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2020-03-09 17:56:52] cmb@php.net
The other bug has been fixed, so I wonder whether that resolved
this issue as well.
------------------------------------------------------------------------
[2019-02-11 02:32:36] ryan dot brothers at gmail dot com
I just submitted bug 77597, where now in PHP 7.3.2, calling mysqli_fetch_field hangs the script
completely.
------------------------------------------------------------------------
[2016-05-31 20:38:08] notvalid at gmail dot com
Also of note, CPU utilization is maxed out during the delay in returning the list of fields. On a
result set with over 1m rows, MYSQLI_STORE_RESULT_COPY_DATA results in over a 30 minute call to
fetch_fields() while disabling MYSQLI_STORE_RESULT_COPY_DATA returns data from fetch_fields() almost
immediately.
------------------------------------------------------------------------
[2014-12-05 04:15:40] ryan dot brothers at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=68548&edit=1