Re: PDO fetch performance problems with many bind parameters
| From: | Matteo Beccati | Date: | Fri, 28 Aug 2020 18:36:02 +0000 |
| Subject: | Re: PDO fetch performance problems with many bind parameters | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111705@lists.php.net to get a copy of this message | ||
Hi Gabriel,
> Let's have this patch merged into PHP 8.0 (
master branch
> as of today), I
> have nothing against it.>
> About PHPs 7.3 and 7.4: if the performance improvements are this massive as
> describe in this email, I'm :+1: to have it on those versions as well.
The mileage may very: running the Doctrine test suite, for example,
shows no difference at all.
On the other side of the spectrum, a SELECT * FROM tbl WHERE id IN (?,
...) and 65535 parameters:
https://gist.github.com/mbeccati/6f2cd094c38b094cb4bfc4c0245a23ab
root@jameson /tmp # /tmp/php-7.4-std bench_pdo3.php
Got rows: 65535
[Timings] prep: 0.018, exec: 0.210, fetch: 35.812
root@jameson /tmp # /tmp/php-7.4-opt bench_pdo3.php
Got rows: 65535
[Timings] prep: 0.019, exec: 0.208, fetch: 0.026
That's almost 36 seconds vs 26ms.
Cheers
--
Matteo Beccati
Development & Consulting - http://www.beccati.com/