300% unique



  • When you want to make sure a column in the db is really, really, really unique:



    [URL=http://img200.imageshack.us/i/sidebarw.gif/][IMG]http://img200.imageshack.us/img200/91/sidebarw.th.gif[/IMG][/URL]



  • @Nelle said:

    When you want to make sure a column in the db is really, really, really unique:
    Yea, I want unique dB to un-ique - plz send me teh Coeds!!

    EDIT: Hard day; Had beer.
    FYI - Really, really, really unique is the least of your problems: One of the applications I support (1st / 2nd level only - thank Christ) has non-unique primary keys; this has yet to cause problems (?) but it makes me feel all dirty just knowing about it. Then in a web app I support, I'm being asked to reuse the same values to authenticate 2 different accounts knowing it'll cause hell (apparently of my colleagues take the adage "the customer is always right" literally)



  • I guess it's to prevent this sort of thing that Oracle won't let you create an index with the same set of columns as an existing index.

    Though it would have been interesting if one index was unique and the others weren't :)



  • No, but, you see, the more keys you have, the faster it will run! This is some high-tech DBA voodoo you've got here! TRWTF is that there are only 3 of them. Every GOOD DBA knows that you should have AT LEAST 100!!



  • @toth said:

    Every GOOD DBA knows that you should have AT LEAST 100!!

    Every smart DBA, however, sets up a cron job that adds 1 unique keys every night. It's like a Speed-up Loop, just automated.



  • @derula said:

    @toth said:
    Every GOOD DBA knows that you should have AT LEAST 100!!

    Every smart DBA, however, sets up a cron job that adds 1 unique keys every night. It's like a Speed-up Loop, just automated.

    And this is why you are a better DBA than I. My hat is off to you and your hundreds of unique keys!



  • @nat42 said:

    One of the applications I support has non-unique primary keys;

    Then they're not really primary keys... a PRIMARY KEY in SQL is implicitly UNIQUE.



  • @toth said:

    @derula said:
    @toth said:
    Every GOOD DBA knows that you should have AT LEAST 100!!

    Every smart DBA, however, sets up a cron job that adds 1 unique keys every night. It's like a Speed-up Loop, just automated.

    And this is why you are a better DBA than I. My hat is off to you and your hundreds of unique keys!

     

    So... if the speed of my DB grows linearly with the number of unique key columns and nothing else, how many columns do I need before my program is fast enough to predict the future states and positions of all atoms in the universe?



  • @PSWorx said:

    So... if the speed of my DB grows linearly with the number of unique key columns and nothing else, how many columns do I need before my program is fast enough to predict the future states and positions of all atoms in the universe?

    Depends. Is Growth Of Universe = O(Increase Of Unique Keys In The Database)?



  • @PSWorx said:

    So... if the speed of my DB grows linearly with the number of unique key columns and nothing else, how many columns do I need before my program is fast enough to predict the future states and positions of all atoms in the universe?

    10 years. But by then, Microsoft will have come out with a new SQL Server version and Management will require that you upgrade, and in doing so your data will become corrupted and you'll have to restore your database from a backup and start all over again, until the solar system dies of heat death.


Log in to reply