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

From: Date: Tue, 02 Aug 2016 16:10:50 +0000
Subject: Bug #72736 [Opn]: Slow performance when fetching large dataset with mysqli / PDO
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202832@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72736&edit=1

 ID:                 72736
 User updated by:    petr dot hrabal at gmail dot com
 Reported by:        petr dot hrabal at gmail dot com
 Summary:            Slow performance when fetching large dataset with
                     mysqli / PDO
 Status:             Open
 Type:               Bug
 Package:            *Database Functions
 Operating System:   Debian 8
-PHP Version:        7.0.9
+PHP Version:        7.0.9, 7.1.0-dev
 Block user comment: N
 Private report:     N

 New Comment:

Expected resaul is that performance should be at least comparable and not dramaticaly worse


Previous Comments:
------------------------------------------------------------------------
[2016-08-02 14:55:57] petr dot hrabal at gmail dot com

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 this bug report at https://bugs.php.net/bug.php?id=72736&edit=1


Thread (9 messages)

« previous php.bugs (#202832) next »