12

I noticed D7 creates a field_revision table for every field, and duplicates the content from its field table counterpart even if one has revisions turned off.

I have a big text table and it is taking up a lot of space (several GBs).

Would it be safe to truncate the revision table?

PS: Meanwhile, I have also reported this as a bug.

  • This is actually a good question! I think the table is created by core but only gets records inserted if revisions is enabled. – stefgosselin Dec 13 '11 at 6:17
  • Thanks :) that was what I expected as well, but it seems D7 creates revision copies regardless. This was confirmed here drupal.stackexchange.com/questions/7027/… . Perhaps a core bug? – giorgio79 Dec 13 '11 at 6:20
  • I will categorize this as a feature, not a bug ;) I think the logic beyond that is that if you change your mind and activate revisions, it would be way to much overload on the DB to suddenly populate all the field_revision_* tables. – tostinni Dec 13 '11 at 15:58
  • 1
    I have plenty, but I dont think this has anything to do with contrib modules. Just look inside your db, and you will see every field has a field_revision table associated... – giorgio79 Dec 14 '11 at 8:27
  • 2
    Possible duplicate of How I can delete all node/field revisions? – Yusef Mohamadi Mar 16 '16 at 17:46
3

I think there the Field SQL norevisions module will help you out:

Field SQL norevisions provides a field storage backend that prevents entity revisions from being saved to the MySQL storage backend.

The purpose of the module is to reduce the amount duplicated data that is saved on large Drupal sites that do not use revisions. It has the additional performance benefit of halving the number of queries during creating entities with fields.

This module will not allow revision fields to be created so it will increase your performance as number of queries will get reduced, besides that you will have no revisions on nodes further.

Also you can use some custom module codes provided on following URL:

http://www.ambidev.com/make-your-drupal-7-faster-by-removing-all-revisions/

and this module to delete revision entries:

https://www.drupal.org/project/node_revision_delete

1

You should have a look at this How I can delete all node/field revisions?, and perhaps subscribe to http://drupal.org/node/1063266#comment-5268252

  • 1
    No offense, but he was asking if it was safe to truncate the field_revisions, not how to delete them. – o_O Sep 14 '12 at 1:30
0

No, it is not safe. I am using Drupal 7. I use quiz module on my website, and I noticed there at least were two error when I emptied all the field_revision_* one with variable error which I do not really remember, and the other one was the questions were disappeared.

Oddly enough, answer options were there, but all the questions were gone. I did not look into more details, I put the field_revision_* tables back and it started working properly.

All I can say is if you use quiz module and go to myPHPAdmin and truncate these tables, you will get errors. If you don't use quiz module, I don't know. but it is not bulletproof. I would recommend using some proven modules to clear your revisions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.