What command is executed when you Optimize Database?

Does anyone know what sqlite command is run when you select Optimize Database from the Troubleshooting menu? Is it just a vacuum command or is there more to it?

Can any employee of Plex answer this quick question for me? I need to know because whenever I run Optimize database from Plex, it often crashes the server, and I think it might be due to the sheer size of my database. So I want to figure out ways I can run it externally using command line sqlite commands. Thanks!

I know that it performs a VACUUM.
It also rebuilds some full-text search indexes.

I’m not sure what else. I’ve been meaning to investigate further myself.

How big is your database?

Thanks, yes I was pretty sure it does a vacuum command but I really wish I could figure out what else it does, so I can run those commands externally.

Did you want to know the size of my database file? Or the number of items in my library? The com.plexapp.plugins.library.db file is currently 1.7GB, if that’s what you were referring to.

I recently did a complete system rebuild, since I was having tons of instability issues, and I realized the database was a good 3-4 years old. Before the rebuild, the database was 2.5GB (pointing at the same media). So clearly the rebuild got rid of some garbage. Even still, I’m continuing to have problems when I try to do an Optimize Database from within the Plex UI.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.