-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server - Table events grow constantly #9931
Comments
Yes there should be something to clean this up. In the meantime you can run a query such as |
Hello, I have a problem with a continuously increasing database, too. I have already opened a thread in the forum two weeks ago, but without any answers yet: https://discourse.joplinapp.org/t/joplin-server-sql-dump-increases-every-day/35542 I don't know if it's the same reason, but I suspect it is. I hope it's okay if I reuse my original text here: Operating system Joplin version Hello everyone, I am using the Joplin App on different devices (Linux, Windows, Android) with syncing to Joplin Server (v2.13.3 / v2.14.2), which uses PostgreSQL for storage. Every night a backup script runs which executes pg_dumpall. Everything works fine and as intended, but the size of the SQL dump increases every day by approx. 1,2 MB without adding any new content from user side. Even during vacation with no syncs it increases. If I stop the Joplin Server container but keep PostgreSQL running, the dumps are identical every day. So Joplin Server adds a lot of data to the database every day without user interaction. For example: The today's SQL dump has 154,6 MiB, the complete Backup with the desktop app exports a JEX file with only 19,6 MiB. The web frontend of Joplin Server reports "Total size 29.2 MB (0%)". This ~1,2 MB per day are not a problem for the local storage, but generates unnecessary data for further online backup of the dumps. Therefore my questions are:
Thanks a lot for your support! |
In the meantime I have created a cron job on the server with the SQL statement provided by laurent22 above. It works, but it would be better and less cumbersome if it was built right into the software. Out of curiosity: What is the exact purpose of the event entries every second and why was the deletion period of one week chosen in the SQL example above? |
Operating system
Linux
Joplin version
Server - v2.13.3
Desktop version info
Server Joplin v2.13.3 installed on docker with PostgreSQL
Current behaviour
Table events has milion of records, and grows every second.
![image](https://private-user-images.githubusercontent.com/11061359/304425962-3f72350a-9c4b-4fe3-9903-0dcb05ab9bfd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvb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RmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE3VDE3MjkyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE3NDhkMmQ0ZjQ4YWIxNTI2ODNhNzI2NzhjM2E0ZmZjMzdjOGQyMjc0YzE4NWI0MWJlM2E0ZjQyODdjZWM4OTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.svGe3p3NJpUXullhB10aSnFl_Uhb2Q3AjSYQDm1ycow)
here's an example of the latest line on my DB, as a workaround can oldest record can be deleted from this table or it will brake something on server sync?
I have 15MB of notes (attachments included) and 400MB of events table
Expected behaviour
Events table should be deleted by a rolling windows
Logs
No response
The text was updated successfully, but these errors were encountered: