|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-12-02 23:39 UTC] don at smugmug dot com
[2010-12-03 03:36 UTC] don at smugmug dot com
[2010-12-03 04:27 UTC] wez@php.net
[2013-03-19 16:34 UTC] mike@php.net
[2013-03-19 16:34 UTC] mike@php.net
-Status: Open
+Status: Analyzed
[2013-03-19 17:44 UTC] don at smugmug dot com
[2013-03-19 21:43 UTC] mike@php.net
[2014-01-01 12:46 UTC] felipe@php.net
-Package: PDO related
+Package: PDO MySQL
[2020-08-28 14:13 UTC] cmb@php.net
-Status: Analyzed
+Status: Duplicate
-Assigned To:
+Assigned To: cmb
[2020-08-28 14:13 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 13:00:02 2025 UTC |
Description: ------------ When retrieving results from prepared PDO statements against MySQL, we get performance that diverges from expected by 10X or more on results as low as 10000 rows. This only occurs for 'SELECT ... WHERE Id IN ( .. )' queries. The attached script provides two PDO prepared approaches ('row-prepared', default, and 'all-prepared') as well as a variety of control methods that use non-prepared PDO queries, straight MySQL, and prepared queries using MySQLi. Only PDO with prepared queries exhibits the problem. If the query is broken up into chunks that return 1000 rows or less prior to execution, then combined afterwards in PHP, performance is as expected. Test script: --------------- You can get the sample script from: http://www.smugmug.com/test/pdo-problem.php.gz Expected result: ---------------- pdo-problem.php?type=row-prepared and pdo-problem.php?type=all-prepared should return in ~0.5s, like the other types (row, all, chunk, mysql, mysqli). Actual result: -------------- pdo-problem.php?type=row-prepared and pdo-problem.php?type=all-prepared return in ~6s instead of ~0.5s