tgdrive / teldrive

Telegram Drive
MIT License
1.8k stars 266 forks source link

Deleting files & database size #254

Closed Xabiman closed 4 months ago

Xabiman commented 5 months ago

If I delete a Teldrive folder with a lot of files inside, will my Neon database size decrease? I've some folders with video files that seems to be corrupted, those videos get error when trying to play (all videos of the same folders). I'm going to delete those folders and re-upload them again, but I'm not sure what will happen with my Neon database size...

steffen-poulsen commented 4 months ago

Yes, the neon database size will decrease automatically as the number of rows in the files table decreases. There is no need to run an "optimize" pgsql command or similar.

I hit an undocumented 1.000.000 file limit for Telegram channels recently, making some files and folders disappear for me also.

If you happen to have hit the same limit, uploading these videos again will unfortunately make some other files disappear.

Just a heads up :-)

Xabiman commented 4 months ago

Thanks @steffen-poulsen for your help. Unfortunatelly my database size doesn't decxrease deleting files (I have lots of dupplicate files for my mistake), I have deleted them but the database size does't decrease. Do you knw how to solve this with no risk?

steffen-poulsen commented 4 months ago

Do you knw how to solve this with no risk?

Xabiman: The only thing I can think of, would be some kind of retention going on?

You can learn about WAL-records and retention here: https://neon.tech/docs/introduction/usage-metrics