Solved

Optimize MYSQL Database

Posted on 2013-06-19
4
762 Views
Last Modified: 2013-06-25
Hello Experts,

Hoping someone with patience can walk me through optimizing a MYSQL database as I am new to MYSQL.  I have never understood why developers don't clear white space in files as part of a general/common routine.  

Anywho, the database that I'm trying to shrink/optimize white space is a Sonicwall Viewpoint MYSQL database = gmsdatabase.

I have the MySql workbench 5.2.  I'm able to open the database but how do I optimize all tables in all databases?  I have tried OPTIMIZE, MYSQLCHECK, it doesn't recognize the commands.  I wish I could just right click on the database and select Optimize.  You would think that something so common would be right there....   Uggghhhh

Thanks!!
0
Comment
Question by:CompTech810
4 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39260613
Here are the instructions http://dev.mysql.com/doc/refman/5.6/en/optimization.html but I'm not sure that they will do what you want.  Standard database and table optomizations do not change the data.
0
 
LVL 23

Expert Comment

by:nemws1
ID: 39260879
Your definition of "optimize" seems to be different than mine. :)

Sounds like you got some junky data (remember: garbage in, garbage out).

You can do this on any columns of data that extra whitespace at the end that you don't need:

UPDATE table
SET bad_field = RTRIM(bad_field)
;

But if you have many fields and many tables this may be a pain in the butt (although I could easily whip up a dynamic query to *generate* the above UPDATE commands quite easily.).
0
 
LVL 29

Accepted Solution

by:
Olaf Doschke earned 250 total points
ID: 39273805
I also if there is any database in which removing white space would be called optimization, perhaps compression, as in MS Access. But even there it's not about the whitspace in text fields, it's about removing garbage, deleted rows, etc.

Optimization is about indexes, most of the time, not about the data itself.

Also you can only remove whitespace from variable length fields.

What performance advantage do you expect? Data transfer typically is compressed automatically at leas on the http request level, where one header defines accpeted compressions like gzip, deflate.

Bye, Olaf.
0
 
LVL 2

Author Comment

by:CompTech810
ID: 39274487
From different things I have read I was made to believe that there was some type of maintenance that should be done.  I now believe that the size of the file is do to a change in data collected.

Thanks.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Loading csv or delimited data files to MySQL database is a very common task frequently questioned about and almost every time LOAD DATA INFILE comes to the rescue. Here we will try to understand some of the very common scenarios for loading data …
As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now