Rails 3.2
I am using the PaperTrails gem to track activities in several models. The problem I'm having, is that the size of the versions table is getting out of control, and it's affecting performance.
Anyone else run into this situation, and if so, do you have any advice?
.. the size of the versions table is getting out of control, and it's affecting performance.
Do you need to keep all versions for all time, or is it OK to keep only most recent N versions per record?
I need all versions
Keeping fewer versions is the best solution, but even if you must keep all versions, you have a few options.
object
column in your versions
table. This will save you 50% disk space, but you will not be able to reify
. Also, support for rails 3 was dropped in PT 6, so you'd have to upgrade rails (you really should, anyway. rails 3 is dead).object
column, you can split your versions
table into multiple tables using Custom Version Classes. However, this technique is not supported by PT-AT yet.