paper-trail-gem / paper_trail

Track changes to your rails models
MIT License
6.79k stars 896 forks source link

Suggest using numeric `whodunnit` column type for performance #1456

Closed fatkodima closed 1 month ago

fatkodima commented 9 months ago

We are currently using paper_trail and have billions of items in the versions table and the table is huge. One of the easy improvements that could have been done back then was using numeric type for whodunnit column. We currently plan to switch to integer which is 4 bytes, while using strings to store integer values can easily require much more space, like for 1000000 it will require 8 bytes (padding included), so twice the space. And also integers have statis types, which is easier for databases to work with.

So, I think it is a good idea at least to suggest people to consider switching to numeric types in the migration's comment.

github-actions[bot] commented 6 months ago

This PR has been automatically marked as stale due to inactivity. The resources of our volunteers are limited. If this is something you are committed to continue working on, please address any concerns raised by review and/or ping us again. Thank you for all your contributions.

fatkodima commented 6 months ago

Ping.

github-actions[bot] commented 2 months ago

This PR has been automatically marked as stale due to inactivity. The resources of our volunteers are limited. If this is something you are committed to continue working on, please address any concerns raised by review and/or ping us again. Thank you for all your contributions.

fatkodima commented 2 months ago

Ping.

jaredbeck commented 1 month ago

Good suggestion, thanks