Bug #72736 [NEW]: Slow performance when fetching large dataset with mysqli / PDO

From: Date: Tue, 02 Aug 2016 14:56:01 +0000
Subject: Bug #72736 [NEW]: Slow performance when fetching large dataset with mysqli / PDO
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202825@lists.php.net to get a copy of this message
From:             petr dot hrabal at gmail dot com
Operating system: Debian 8
PHP version:      7.0.9
Package:          *Database Functions
Bug Type:         Bug
Bug description:Slow performance when fetching large dataset with mysqli / PDO

Description:
------------
I have large MySQL query (1.8M rows, 25 columns -  all string between 20
and 256 chars) and I need to make 2 dimensional array from it (memory
table based on primary key).

Code works as expected, but $table creation takes a long time in
PHP7.0.9 or 7.1.0-dev

same proble apears when PDO is used
more extensive info/diagnostics at 
http://stackoverflow.com/questions/38614982/mysqli-fetch-assoc-performance-php5-4-vs-php7-0

with tested dataset PHP5.x performs 10 times faster

Test script:
---------------
$vysledek = mysqli_query ( $conn,"SELECT * FROM table WHERE 1");

while($zaznam = mysqli_fetch_assoc ( $vysledek )){
  $table[$zaznam['prikey']] = $zaznam;
}



-- 
Edit bug report at https://bugs.php.net/bug.php?id=72736&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=72736&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=72736&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=72736&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=72736&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=72736&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=72736&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=72736&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=72736&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=72736&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=72736&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=72736&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=72736&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=72736&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72736&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=72736&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=72736&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=72736&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72736&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=72736&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=72736&r=mysqlcfg



Thread (9 messages)

« previous php.bugs (#202825) next »