I used v3.4.6 to try to optimize a 49MB MariaDB Aria WordPress database (the website has 2995 total pages & posts). Revisions, trashed items, and expired transients were deleted, but the database tables were not optimized. However, it appears that no damage was done. Except for the deleted items, everything else seems to be exactly as it was before.
I ran that trial with WordPress 4.2.3 using:
Server version: 10.0.20-MariaDB-1
version_compile_machine: x86_64
version_compile_os: debian-linux-gnu
version_malloc_library: bundled jemalloc
I just learned there is an aria_chk utility that can be used to check, repair, optimize, sort and get information about Aria tables. However, you will see this note on the page I just linked to:
“Note: aria_chk should not be used when MariaDB is running. MariaDB assumes that no one is changing the tables it’s using!”
So, even if there was a way to run it, it obviously shouldn’t be run from a WordPress plugin.