[MDEV-32216] mysqldump: use --tab (or another option) to increase performance and parallelism significantly Created: 2023-08-29 Updated: 2024-01-30 Resolved: 2024-01-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Fix Version/s: | 11.4.1 |
| Type: | New Feature | Priority: | Critical |
| Reporter: | Yakov Kushnirsky | Assignee: | Vladislav Vaintroub |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Preview_11.4 | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
Add a new option --use-threads, it will apply only to the mariadb-dump -T mode and will make it to dump tables in that many threads. If --single-transaction is specified too, should use a consistent snapshot over all threads. |
| Comments |
| Comment by Vladislav Vaintroub [ 2023-11-14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
That might need some clarification - currently
does not handle more than a single database. Therefore - "How to export 100+ databases and tables on busy and active transactional system" will require 100+ mysqldump --tab invocations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Max Mether [ 2023-11-14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Any chance to get --tab to work with multiple databases? Or should that be a different ticket? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Vladislav Vaintroub [ 2023-11-14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@Max, not without breaking compatibility. Currently, --tab creates in the output directory <table_name>.sql with "CREATE TABLE" and <table_name>.txt with the data, for each table. There is no SQL for "CREATE DATABASE" or such. there are no subdirectories. file names do not reflect database name, but they are compatible with mysqlimport. To handle databases it needs an incompatible extension - e.g create_databases.sql in the output directory, maybe subdirectories for each DB with <table_name>.sql and <table_name>.txt in them. and it might need some corresponding option in mysqlimport (i.e import "directory" , not a bunch of .txt files) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Max Mether [ 2023-11-14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Yes, definitely sounds out of scope for this task then. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2023-12-06 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
OK to send for testing after fixes small things I have mentioned | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Lena Startseva [ 2024-01-03 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Testing done. Ok to push | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2024-01-03 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
lstartseva, could you please also see how it works with big multi-GB databases? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Lena Startseva [ 2024-01-23 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I checked on my laptop with the next environments and characteristics: Data: Results: The maximum value of the parameter --parallel is 5, because further increasing the number of threads did not lead to decrease the execution time. The minimum time was limited to the dump time of the largest table.
Database:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Lena Startseva [ 2024-01-23 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
After checking on big databases also Ok to push |