- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
There is some-fin fishy going on here!
Admin
A building in NY you say...
Maybe... ... apply the established 9/11-pattern?
Admin
There's a lot of reasons a DB would not store date of birth. For example, an employer may not be legally allowed to ask. And in any case, having a distinct number assigned to a DB record can be handy just because (for example) it allows you to easily reference that record on other tables. Multi-value keys can be a pain that way...
But yeah, my friends case was a clear example of (willful) human error - I suspect the cops were using it as an excuse to execute un-waranted searches. "Whoops, we arrested the wrong guy. And gee, his car turned up clean, so I guess we can't hold him for more than 24 hours."
Admin
I can't sea why weed have to keep dredging up the same mold smelly puns. I am whaling from the horror.
Time to go back to my favorite stock market game: buy low, shell hi.
Admin
There are many cases where a meaningless integer (or varchar(64), if you've had the pleasure to work with Siebel) is the best choice for a primary key, but to state that anything else is a 'fundamentally flawed design technique' is sweeping, simplistic and incorrect.
Admin
I always knew the French were really communists. And Esperantistoj. And pretty much anyone who uses accents.
Admin
Snoofle, I like your frequent yarns in the sidebar, but you might have missed the point.
Collate languuage | case sensitive? | accent sensitive? Collate ... CI AI = ignore case, ignore accent
"where A LIKE B" is lazy-hand SQL for "where A = B"
BTW, = is ==, not =. SQL is more equal than other syntax.
Admin
So many people forget that the "L" in SQL is for LANGUAGE. There are many, many very useful operations that can be performed in SQL. This example illustrates its power.
Admin
Hang on, I can see where this is going ...
Two bad boys bring down the entire government database system by registering with the same name, date of birth and addresses in the same apartment building. The fact that this compromises the critera for a unique primary key causes a key component of the whatever-system to crash. This in turn brings down etc. etc. Now go write the movie.
Admin
Selfish!
Admin
What a fine idea.
GUIDs are 32 bytes long, and because of the way they are generated, are non-sequential. So adding 1 or a million rows to your table can force a table sort; in some cases, slower than a row-by-row rebuild.
Plenty of rant on the googlenetwebs: "Why are GUIDs so fucking stupid as PKEYS?"
Admin
Someone has to this comment.
Admin
When I first saw a database with GUID IDs I thought WTF?
Then when I had to merge multiple relational structures from distributed clones for central statistical analysis I thought genius!
But the best part about GUID IDs is no one is tempted to display them to users, or ask customers to recite them over the phone. This automatically satisfies the "meaningless" part of "permanent, meaningless and unique" that should apply to all primary keys. And of course the U takes care of the unique bit.
Admin
Yo - Zuneeeeeesiiiiis!!!
Admin
TRWTF here is applications which require you to enter "Apply" before pressing "OK" or you lose your changes.
Admin
Illiteracy is shining in this post.
Admin
I can’t think of any business information that is static. It is fun working with a widely used business application that displays company information sorted by the primary key. The users attempt to enter key values to have the sort show the Company names sorted. Then when the company changes its name, the users want to change the key. After about 10 years this application added the ability to sort by other columns, although the primary key is the default.
Admin
Admin
Admin
more to the point is that when they move house you don't need to update every single piece of information you have about them in your database.
Admin
You mean "in the user-submitted comments on the documentation".
Sort of like saying "there's a mistake in that textbook on economics" when the mistake is in the notes someone wrote in the margin. Yes, the mistake is in that textbook, but that's not what that means...
Admin
Admin
Close: what was intended was "Sell fish".
Admin
Hehe, good one. However, people can, and actually do, change genders. Come to think of it, it's kind of surprising I've never heard of a WTF story about that!
captcha: bene (molto molto)
Admin
I once knew a Gottfried Gottfried (the 17th) who was disowned by his family for not naming his 1st born son Gottfried.
Also, I learned a lot about db collation today and plan to incorporate all the great ideas into my current db project. =D
Admin
Also, if the snippet comes from the times in which they didn't, probably didn't have those handy collate statement.
Admin
Why in the hell would this even be a remotely good idea?
"We can only have 4 billion rows."
"4 billion users?"
"No, 4 billion (users + orders + settings + ...)"
Admin
excellent response.
Admin
Admin
Admin
Admin
Most modern RDBMS allow these computed indexes already as CREATE INDEX syntax. So, the trick in [3] is yet another a hack.
For example, PostgreSQL allows indexes on a function:
CREATE INDEX uppercase_person_idx ON person_table (UPPER(last_name));
NoSQL is for very large map-reducible sets. You index problem is not handled any better by such a a DB.
Admin
Bigots rarely do. It's so much easier to hate, when the facts are invented to support the prejudice.
Admin
Yes, esperantistoj are komunistoj. Never trust anyone who uses more than 26 letters (or accents).
Eĥoŝanĝo ĉiuĵaŭde al ĉiuj!
Admin
Seeing as this is a database, perhaps they meant "no codd reuse".
Sorry. I'll get back in my box
Admin
What the hell is it, a bird?
Admin
I know that; you know that; the people who wrote the original query probably don't. They'll see that their query is running like a three-legged dog in quicksand, blame SQL, and demand that the app be moved the NoSQL because it's more "enterprise-y".
When NoSQL fails to solve their problems, they'll probably blame Bob for not knowing what he's doing, and insist that the company hire their high-school drop-out nephews who "know all about computers 'n' stuff".
Admin
Not only that, but the most suitable choice of surrogate key may not be an integer! A UUID (GUID) as mentioned above, a strong (i.e. highly collision-resistant) hash, or a suitably high-resolution timestamp (I know that we use insert timestamp + a numeric partition identifier as a surrogate key on some tables in the app I work on for my day job) may be a better choice than an auto-incrementing integer surrogate key for some applications. It all depends on the dataset you expect to handle, as with any other decision about primary keys.
Admin
Pretty easy. Just use C# RegEx function and expose it in a CLR function.
And no, I do not have that in production, but we "needed" it to track down a problem one day.
Admin
Admin
Captcha: incassum...
Admin
Admin
the original post (included in your post) said:
There's probably also some scope for incorrect entry and 1958 to become 1985 thus making a father and son share a birthday (and a million other things to boot)....Admin
Admin
A) How is writing more characters being lazy B) They don't do the same thing
Admin
Admin
The real WTF is why wasn't the table created with that collation scheme in the first place? Why would you want to run a collation on every query?
Admin
Someone entered my birthday wrong when I signed up for a bank account. Now I have to fax them all sorts of stuff to get it fixed.
(validus: yes it is.)
Admin
Dolphin is a common name for the Mahi-mahi fish: http://en.wikipedia.org/wiki/Mahi-mahi
Admin
If you're running that close to the limit, use a longer integer. Or UUID/GUID, as someone else suggested.