reversion_version table growing big

165 views
Skip to first unread message

naciselim

unread,
Sep 25, 2016, 9:33:31 AM9/25/16
to django-reversion discussion group
Hi,

I realized reversion_version table has grown so big (15GB). Not sure if there are recommended maintenance steps. Could we remove older data, or partition the table?

Thanks,
naci

naciselim

unread,
Sep 25, 2016, 9:38:01 AM9/25/16
to django-reversion discussion group
Sorry for posting before reading more. There is deleterevisions command. Then I need to figure out how old of data should I remove, 1 month, several months, a year?

Thanks
naci

Dave Hall

unread,
Sep 25, 2016, 12:31:55 PM9/25/16
to django-reversion discussion group
I keep data for the last month, but there's no right answer here. It depends on the needs of your users.

--
You received this message because you are subscribed to the Google Groups "django-reversion discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-reversi...@googlegroups.com.
To post to this group, send email to django-r...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-reversion.
For more options, visit https://groups.google.com/d/optout.

vpere...@gmail.com

unread,
Nov 2, 2016, 4:00:59 AM11/2/16
to django-reversion discussion group
I have a "similar" problem. 

My reversion_version tables has grown so big (60GB). However I dont need to rollback anything in any point of time. Reversion is just there to build a history, using set_comment. So for me, I don't need the serialized data at all, just whats happened and when. There is a way to delete the serialized_data without break anything? I would like to keep the history but save space. Django-Reversion was already there as I arrived :) Probably it was the wrong choice for the history feature.

thank you

Dave Hall

unread,
Nov 2, 2016, 6:30:56 AM11/2/16
to django-reversion discussion group
django-reversion doesn't support that use-case, I'm afraid.

If you don't ever use the serialized data, I'd suggest uninstalling reversion and "taking over" the database table using a new model in your app that matches the reversion models. Override db_table on the model meta to match the reversion tables, fake an initial migration, and then edit the model to take out the fields you don't want, mirroring the changes to the database with a migration. The end result is you have a mini "reversion" app of your own with just the features you need.

--

vpere...@gmail.com

unread,
Nov 2, 2016, 10:27:46 AM11/2/16
to django-reversion discussion group
Hey, thank you for your answer and suggestion!

To remove it, isn't so simple since its everywhere and the test coverage for this functionality isn't great.

for now I have a management command which clean the serialized_data "fields" and the field_dict. The downside is that I must run it daily.

Dave Hall

unread,
Nov 2, 2016, 11:53:32 AM11/2/16
to django-reversion discussion group
That'll work, I guess, although in a lot of databases that will have the effect of increasing table size temporarily until the vacuum daemon cleans up.

You could also fork django-reversion and remove the functionality you don't want. Open-source is cool like that!
Reply all
Reply to author
Forward
0 new messages