Re: PDO fetch performance problems with many bindparameters
| From: | Matteo Beccati | Date: | Sat, 29 Aug 2020 07:30:50 +0000 |
| Subject: | Re: PDO fetch performance problems with many bindparameters | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111707@lists.php.net to get a copy of this message | ||
Hi Christoph,
On 28/08/2020 22:57, Christoph M. Becker wrote:
> Can we be certain that the relevant bits of the formerly _reserved_flags
> are zero-filled for all existing drivers?
We can, that's basically the premise of the PR itself:
1. The flags are in the pdo_dbh_t struct which is the dbh->inner part
2. dbh->inner = ecalloc(1, sizeof(pdo_dbh_t)):
3. stmt->dbh is set as dbh->inner, in prepare and query
4. drivers can eventually set some bits to 1.
A few quick links:
https://github.com/php/php-src/blob/658f6ff2dae42c4f2b5c6f8d6adc8c8f09b52b47/ext/pdo/php_pdo_driver.h#L514
https://github.com/php/php-src/blob/658f6ff2dae42c4f2b5c6f8d6adc8c8f09b52b47/ext/pdo/pdo_dbh.c#L562
https://github.com/php/php-src/blob/658f6ff2dae42c4f2b5c6f8d6adc8c8f09b52b47/ext/pdo/pdo_dbh.c#L1085
https://github.com/php/php-src/blob/658f6ff2dae42c4f2b5c6f8d6adc8c8f09b52b47/ext/pdo/pdo_dbh.c#L1481
Cheers
--
Matteo Beccati
Development & Consulting - http://www.beccati.com/