Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is bigint large enough for an event log table?

Now I know that bigint is 2^64; that is, more atoms than there are in the known universe. I shouldn't be worried, as my mere human brain simply can't get around the enormity of that number.

However, let's say that I record every change to every category, product and order in my system, from launch until the end of time. Should I be concerned about the performance of table writes before I worry about running out of primary key values? Should I record events of different priorities to different event tables? Will I run out of atoms on a hard drive before I run out of bigints? How big should I let an event log table get before I start archiving / clearing it out?

like image 444
tags2k Avatar asked Nov 10 '08 10:11

tags2k


1 Answers

Even if every of your entries only had 1 byte, 2^64 entries would occupy around 18000000 TB on your hard drive, so I guess you shouldn't worry about this.

like image 71
schnaader Avatar answered Sep 22 '22 10:09

schnaader