Plex Database sqlite file has more than doubled in 10 days

I experienced this issue several months ago. I noticed it because database optimization on my system went from completing in 4 - 5 seconds to several minutes. This prompted me to check my database size and it had ballooned by an order of magnitude. I used sqldiff to compare the current DB with a normal-sized backup and found that the table statistics_media was being written to constantly, even with no server usage.

Examining the database further, I found that these “rogue” additions were being made with a device_id not present in other entries in the database (or at least not many entries) and the account_id was null. As I had a recent, working database backup, I decided to whack all of the entries with a null account_id; after doing so, my database size reverted to its normal size.

I also signed out all of my known clients and cleaned up my authorized devices in settings. The issue has not recurred since doing so. I’d been playing around various clients (Plex desktop app, Plex Media Player, Plex Amp) around that time, so it may have been something I did with one of those which caused the rogue writes.

I’m not necessarily suggesting you modify your database, particularly if you don’t have recent, working backup. However, it did help in my case.

2 Likes