Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111695 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 75676 invoked from network); 26 Aug 2020 17:35:18 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Aug 2020 17:35:18 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D43D91804DB for ; Wed, 26 Aug 2020 09:38:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: ** X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_20,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DOS_RCVD_IP_TWICE_B, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from box.beccati.com (box.beccati.com [176.9.123.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 26 Aug 2020 09:38:29 -0700 (PDT) Received: from authenticated-user (box.beccati.com [176.9.123.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by box.beccati.com (Postfix) with ESMTPSA id 5BA5D2002F4; Wed, 26 Aug 2020 18:38:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=beccati.com; s=mail; t=1598459907; bh=k50cWGQ7G/g1e1gN3w5TLM2Uqq94Shklk2ub5k1orQs=; h=Subject:To:References:From:Date:In-Reply-To:From; b=lfKSDZTXtQmejNbNoRRxn0lsES8jdjOkdJX2DVgIGCZZe6MfjXDI+cqRfsiFJjzwF k6EwoOvIqJDYtms4jnQZnoB9isgQB6QvToEqaHFSEXSTIL3s+JtxCJXnBtJEzqqbgf gW3vIrbbdn4nIik15oRpctFuH7zYrYDHDy4rfytWzobP5W5P5GwdZ61Wh0C1UgiqHv T9HQrqQGdVsSoGbnykkqvtSXuK1c5drGL1Wti/xmUFpoo1glPysZtBPK8JvCzqu2qE 3Ohas65cQgzoGVMB79/qXXft1cARTzN9ycnZ3E2Q830bu4AJ52jx6UCbGrygdWQIzl tAbqgC4XyExJQ== To: =?UTF-8?Q?Dino_Pejakovi=c4=87?= , PHP internals References: <08b959f5-7652-5e8a-562a-c2659facec8c@voxdiversa.hr> Message-ID: Date: Wed, 26 Aug 2020 18:38:22 +0200 MIME-Version: 1.0 In-Reply-To: <08b959f5-7652-5e8a-562a-c2659facec8c@voxdiversa.hr> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] PDO fetch performance problems with many bind parameters From: php@beccati.com (Matteo Beccati) 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/