Optimizing the database is good practice to keep the site performing well and healthy.
The safest way (least prone to user-error) to optimize a WordPress website is a plugin, which can be found from the WordPress repository, https://wordpress.org/plugins/search/db+optimization. A favorite of mine is Advanced Database Cleaner – WordPress plugin | WordPress.org
Since Advanced Database Cleaner is not one of our products we cannot or will not be able to provide support for the plugin. Please utilize [Advanced Database Cleaner] Support | WordPress.org for support needs with this plugin.