Solved

Optimize MYSQL Database

Posted on 2013-06-19
4
769 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 83

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
Creating and Managing Databases with phpMyAdmin in cPanel.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

11 Experts available now in Live!

Get 1:1 Help Now