-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PDO quote bottleneck #13440
Comments
For MySQL specifically, it might be possibly to optimize the quoter function provided by the driver: |
It looks deceivingly simple, I'll give it a shot tonight. |
These were the right words. I played with it a bit and found a couple of interesting things. I have to do verifications and some cleanup though.
That being said, it seems the majority of the time in the sample script is spent doing IO (as expected). |
Thanks for looking into it. 2x faster would be awesome, as the script will be used for multi GB tables in big databases. Regarding IO and other bottlenecks: I am already working on that |
Is your PHP using mysqlnd or libmysql? |
Didn't get auto-closed, but this is fixed by the commit series ending in 3ddd341. |
Description
running https://github.com/druidfi/mysqldump-php and the following code:
Results in a blackfire profile graph which shows a bottleneck in calling
PDO::quote
:I am using a db-table which contains 1.3 millions rows and contains 16 columns (some varchar, some int)
I guess its kind of expected when running a php tool to dump a db table in which we need to escape every column value which is stringy that we would bottleneck on the escaping function.
I am wondering whether there is some low hanging fruits in
PDO::quote
regarding use-cases which call the function excessively.repro steps
composer install
test.php
fileblackfire run --ignore-exit-status php test.php
PHP Version
PHP 8.1.27
Operating System
ubuntu 22 lts
The text was updated successfully, but these errors were encountered: