How I learned to love number gaps:
I have a database of colleges and universities. Every degree listing
as a numbered id. This used to be auto-incremented. After several
deletes and additions, I found it advantageous to have gaps between
schools to add new degree listings, so that I didn't get a numbering
scenario like School A has degree #s 4, 5, 89, 326 and School B has
#s 6, 7 8, 88, 91, 214, etc. If I have gaps, I have room to keep a
school's degrees together in a sequence. It makes it so much easier
to keep track.
Gaps are only a subjective problem. Objectively, they make no
difference to the database operation, and administratively, they can
be quite useful. When we look past our expectations, we often find
new posibilities.
On 8 Apr 2001, at 20:37, Jens Vonderheide wrote:
> > How would you actually overcome that? Wouldn't it be good if
> > MySQL would be adapted to actually do this for you?
>
> I think that not reusing deleted numbers is easier (i.e. more
> efficient). IIRC, earlier versions of MySQL in fact reused the
> numbers.
>
> There are 2 ways to overcome this:
>
> 1) Check if you really need to rely on numbers without any gaps. If
> you tell us what you want to do, someone on the list may come up with
> a different approach. 2) If you really need that behaviour, you
> shouldn't use auto_increment, but write your own functions to get a
> unique key. I did this once (because I needed to support some RDBMSs
> without auto_increment). It's not that difficult.
>
> Jens
>
>
> ---------------------------------------------------------------------
> 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
>
John Jensen
520 Goshawk Court
Bakersfield, CA 93309
661-833-2858
---------------------------------------------------------------------
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