It all depends on a few different things like how big your database is, are there a lot of post revisions, auto-drafts, post revisions and things along those lines.
If you have a lot of useless junk in your database then it can help clean it up but most the time you will not see much difference in any kind of performance unless your database is full of a lot of the things I mentioned above.
It can't hurt though as long as you do it right. It's easier to do with a plugin like WP-Optimize which you can get for free from the WordPress repository. It's easy to use and works well.