Re: PDO fetch performance problems with many bind parameters
| From: | Matteo Beccati | Date: | Wed, 26 Aug 2020 16:38:22 +0000 |
| Subject: | Re: PDO fetch performance problems with many bind parameters | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111695@lists.php.net to get a copy of this message | ||
Hi Dino,
On 26/08/2020 15:02, Dino Pejaković wrote:
> [snip]
> ||+ // if (!dispatch_param_event(stmt, PDO_PARAM_EVT_FETCH_POST)) {||
> ||+ // return 0;||
> ||+ // }||
> || ||
> || if (do_bind && stmt->bound_columns) {||
> || /* update those bound column variables now */|
>
> After this change, fetching takes ~5ms and nothing seems broken, but the
> whole INSERT/RETURNING is now 10 times faster.
>
>
> Am I understanding this right? Could this be solved by letting each
> pdo_* driver set some kind of a flag (bitmask?) telling PDO which hooks
> it wants called from dispatch_param_event? For example for pdo_pgsql
> that flag would be |PDO_PARAM_EVT_FREE | PDO_PARAM_EVT_NORMALIZE |
> PDO_PARAM_EVT_ALLOC | PDO_PARAM_EVT_EXEC_PRE|, as other case statements
> seem empty.
Nice find, thanks.
I'll have a look into it, although I think anything we do in that area
would target 8.1.
Cheers
--
Matteo Beccati
Development & Consulting - http://www.beccati.com/