> I'm looking for a way to create a table with a ID columns (PRIMARY KEY)
> generated automatically...

> The only probleme is that i cannot use a AUTO_INCREMENT field because I
have
> thousand of lines added each day (and all lines older than a week are
> deleted)    With AUTO_INCREMENT, one day or another I'll reach the size
>limit of the ID field ;-)

If you are adding one line per second (which is significantly more than
your "thousands per day") and you make the ID BIGINT UNSIGNED, you will run
out of IDs after something over 500 billion years. May I suggest firstly
that if the system goes wrong after this time, it will be Someone Else's
Problem, and secondly, that in the intervening millennia, it is highly
likely that the MySQL team will have implemented 128 bit INTS, which will
allow a simple ALTER TABLE to postpone your problem until after the
universe has ended (if it hasn't already).

At one new line per second, even a 32-bit INT UNSIGNED will last over a
century. If I take your "thousands of lines per day" at face value and
assume 10,000 lines per day, you get over a thousand years before 32 bits
run out. When you do run out, ALTER TABLE will add a few more billions of
years.

     Alec Cawley



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to