# Plex Database sqlite file has more than doubled in 10 days

**URL:** <https://forums.plex.tv/t/plex-database-sqlite-file-has-more-than-doubled-in-10-days/626071>\
**Category:** Plex Media Server\
**Tags:** server-linux\
**Created:** [August 22, 2020, 9:36am UTC](https://forums.plex.tv/t/plex-database-sqlite-file-has-more-than-doubled-in-10-days/626071 "2020-08-22T09:36:12Z")\
**Posts on this page:** 1\
**Showing post:** 66

<div class="post-metadata">

**Author:** ![jg121212](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jg121212/32/222595_2.png) [@jg121212](https://forums.plex.tv/u/jg121212)\
**Post date:** [January 28, 2021, 7:15pm UTC](https://forums.plex.tv/t/plex-database-sqlite-file-has-more-than-doubled-in-10-days/626071/66 "2021-01-28T19:15:51Z")

</div>

I just removed a ton of these account\_id=NULL entries from the statistics\_media table. Not sure what is causing them. That table was by far the largest table in the database before, now it is somewhere in the middle.

For anyone that needs to remove these here are the steps:  
Stop Plex  
Open a command window and navigate to the Databases directory, in windows it is:  
`C:\Users\your_name\AppData\Local\Plex Media Server\Plug-in Support\Databases`  
Create a backup copy of your com.plexapp.plugins.library.db file before doing anything.  
`copy com.plexapp.plugins.library.db com.plexapp.plugins.library.db.backup`  
Open the database in sqlite3  
`sqlite3.exe com.plexapp.plugins.library.db`  
If you want to see how many rows have a NULL account id run the following command  
`select count(*) from statistics_media where account_id is NULL;`  
Run the following command to delete the rows with NULL account\_id  
`delete from statistics_media where account_id is NULL;`  
Start Plex  
In Plex go to Settings / Troubleshooting and click Optimize Database

---

_[View the full topic](https://forums.plex.tv/t/plex-database-sqlite-file-has-more-than-doubled-in-10-days/626071)._
