Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Optimize MYSQL Database

Posted on 2013-06-19
4
Medium Priority
?
814 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 84

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 30

Accepted Solution

by:
Olaf Doschke earned 500 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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 …
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

704 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