How Many IDs In A Database?

Current snapshot of the FATE database:

And we’re just getting started. This might be construed as either long-term planning or silly paranoia, but I have started to wonder what it would take to overflow the id field of the test_result table. I’m not even sure how large it is. MySQL simply reports the database field as being type “int(11)”. I have read various bits of literature which do not give a definitive answer on just how many bits that is. Worst case, I am assuming 32 bits, signed, with a useful positive range around 2 billion. Suppose I ramp up to around 500 unique tests in the database (hey, with all the individual regression tests yet to be imported, as well as various official conformance suites, that’s actually a fairly conservative estimate) and add 6 more configurations to round out to 20. That means each build/test cycle will generate 500 * 20 = 10000 test results. If there are 10 cycles on an average day, that means 100,000 test results per day and 3 million per month. That would last the 31-bit range for about 715 days, or nearly 2 years.

Okay, I guess I will put off worrying about the implications for the time being. But I still need to revise the test_result table to be more efficient (i.e., quit storing the stdout field if it’s the same as was specified in the test specification).

4 thoughts on “How Many IDs In A Database?

  1. Diego Flameeyes Pettenò

    If each test has its own table with its ID, and each run also has its own table and its ID, you can easily make your primary key (test, run) rather than just (id). This should make it way more difficult to overflow the primary key.

  2. Multimedia Mike Post author

    Creating a new table for each test spec seems a little extreme (500+ individual tables? maybe I misunderstood you). But I can see where you’re going with the idea of making the primary key the combination of (build record id, test spec id) and eliminating the de facto autoincrementing id altogether. I will weigh this possibility, especially since the test result’s id is not referenced from any other table.

  3. Multimedia Mike Post author

    The only disadvantage I can think of right away is that I will need to revise the PHP reporting script to address a particular test result by 2 IDs rather than just 1.

Comments are closed.