Library.db size more than doubled in latest version

From a C:\ prompt. Four commands. You can copy and paste the individual commands if Plex is installed in the default locations. Stop Plex Media Server before running the commands.

c:\>"C:\Program Files\Plex\Plex Media Server\Plex SQLite.exe" "%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db"
sqlite> delete from statistics_bandwidth where account_id is NULL;
sqlite> VACUUM;
sqlite> .quit

IMPORTANT: Note the semi-colons after the SQLite commands. They are important. The command will not run without it. The same with the period before quit.

The delete command may take minutes or hours, depending on the amount of data to remove, CPU speed, and hard drive/ssd speed.

Here is an example running on my Windows 10 PC, reducing a ~1 GB database to ~280 MB. This took about four minutes (i7-4790K & db on a SSD). It will obviously take much longer with a database of tens or hundreds of GB.

c:\>dir "%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases"
05/23/2025  18:14       220,037,120 com.plexapp.plugins.library.blobs.db
05/23/2025  18:14     1,083,310,080 com.plexapp.plugins.library.db


c:\>"C:\Program Files\Plex\Plex Media Server\Plex SQLite.exe" "%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db"
SQLite version 3.39.4 2022-09-29 15:55:41
Enter ".help" for usage hints.
sqlite> delete from statistics_bandwidth where account_id is NULL;
sqlite> VACUUM;
sqlite> .quit


c:\>dir "%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases"
05/23/2025  18:14       220,037,120 com.plexapp.plugins.library.blobs.db
05/23/2025  18:18       280,846,336 com.plexapp.plugins.library.db

c:\>
1 Like