Skip to content
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

1.1.0 features #38

Merged
merged 15 commits into from
Mar 3, 2024
Merged

1.1.0 features #38

merged 15 commits into from
Mar 3, 2024

Conversation

back-2-95
Copy link
Member

@back-2-95 back-2-95 commented Feb 25, 2024

@back-2-95
Copy link
Member Author

@staabm as a first step I gathered the PRs as one here. Tests pass and Packagist has a version for testing.

@back-2-95
Copy link
Member Author

@staabm My first test on a Drupal site which also does GDPR transforms on certain fields. I use Orbstack on M1 Pro Mac.

Version 1.0.2: 40s
This branch: 5s

Wow!

@staabm
Copy link

staabm commented Feb 27, 2024

Sounds perfect. I will also do some more testing this week

|| !$this->settings->isEnabled('extended-insert')) {
$onlyOnce = true;
$lineSize = $this->write(';' . PHP_EOL);
$this->write($line . ';' . PHP_EOL);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we are buffering rows into batches with this PR, it might make sense to emit a event at this point in time, so a possible progress indicator could also update when a table dump is in-flight.

otherwise dumping huge tables will not see any progress updates for - in our case - 20-30 minutes.

see also #39

I would propose something like

Suggested change
$this->write($line . ';' . PHP_EOL);
$this->write($line . ';' . PHP_EOL);
($this->infoCallable)('table', ['name' => $tableName, 'rowProgress' => $count]);

Copy link

@guvra guvra Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another call before the foreach loop is also needed, otherwise the dump info will display an incorrect table name until the 1st million characters were processed.

Also maybe adding a state instead of rowProgress, e.g.:

Before the start of the foreach:
['name' => $tableName, 'completed' => false, 'rowCount' => 0]

Within the foreach loop:
['name' => $tableName, 'completed' => false, 'rowCount' => $count]

After the foreach loop:
['name' => $tableName, 'completed' => true, 'rowCount' => $count]

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valid points. I like your idea more than mine

@staabm
Copy link

staabm commented Feb 28, 2024

Would be great this could be merged so I could work on other stuff

staabm and others added 2 commits February 29, 2024 15:38
one less space per row in the dump can make a considerable difference in file-size
@back-2-95
Copy link
Member Author

Hi, I’m in bed with flu or something so my countribution will go to next week 🤒
Lähetetty iPhonesta

@staabm
Copy link

staabm commented Feb 29, 2024

All the best. Get well soon

@back-2-95 back-2-95 merged commit df0e3bc into main Mar 3, 2024
15 checks passed
@back-2-95 back-2-95 deleted the 1.1.0-features branch March 3, 2024 10:20
@back-2-95
Copy link
Member Author

New release available https://github.com/druidfi/mysqldump-php/releases/tag/1.1.0

@staabm
Copy link

staabm commented Mar 3, 2024

Thank you 🙏

@staabm
Copy link

staabm commented Mar 7, 2024

Fyi, the remaining perf bottleneck in pdo->quote() should also be widened with the next php-src release

php/php-src#13440

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants