- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Best Way to compress mysqldump?
The compression operation is used only if both client and server support ‘zlib’ compression, and the client requests compression.
Usage of mysqldump
The advantage of using compression is that it reduces the size of the payload
On the other hand, the disadvantage of using compression is that it increases the computation time.
Performance benefits will depend largely on the size of the result set which is being sent.
In addition to this, the network bandwidth and latency between the database server and its clients also matters. The larger the result set, the larger will be the latency.
In other words, the lesser the bandwidth, the more likely the user would see the benefit of compression.
The maximum level of service is limited to the smallest bottleneck. Hence, it is required to analyse the position regarding network and CPU resources in the current time.
The most optimized database server would utilize 100% of its CPU 100% of the time, otherwise the computing resources get wasted if it has a processor that is sitting idle.
A table can be rebuilt by dumping and reloading it. This can be done by using the ‘mysqldump’ and creating a dump file and allowing mysql to reload the file. This can be done using the below commands −
mysqldump db_name t1 > dump.sql mysql db_name < dump.sql
If the user has a large mysqldump file, and they wish to import it from one system using FTP to another, without having to spend more time on it, it can be done using the below command
mysqldump −u root −p database_name | gzip > dump.gz
Another way is to zip the contents of the file, but this wouldn’t be considered the best way.
- The best way to compress and extract files using the tar command on linux
- Best way to null check in Kotlin
- Best way to store date/time in MongoDB?
- Best way to store weekly event in MySQL?
- Best Way to Install Go 1.7 on Ubuntu
- Best way to connect to SAP system from JAVA
- What is the best way to stop Brain Drain?
- What is the best way to earn money online?
- Best way to combine multiple advanced MySQL select queries?
- Best way to sum array size fields in MongoDB?
- What is the best way to log a Python exception?
- Best way to change the date format in MySQL SELECT?
- What is the best way to check capacity in Java?