- 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
At least he didn't use XML on DataType column...
Admin
Wouldn't that only be enterprisey enough if the offsets had been defined in a table?
Apart from that: If someone seems to be guarding their secrets a little too zealously, don't be afraid, be VERY afraid.
Admin
If you are going to base this on elapsed times, then you need to get the data buffered the same, and the disks the same speed. That is hard to do on your laptop. But you could measure teh CPU used instead, and still see a large difference.
Admin
It could have been an indexed view, no?
Still would make more sense to parse during import, but nevertheless, if it took less than 1 second to look up records, the view could very well have been indexed even if the table wasn't.
Admin
I dare to ask, but you ARE aware about expression indices, aren't you?
Example: http://www.postgresql.org/docs/8.3/interactive/indexes-expressional.html
Admin
I think since DTS was mentioned it's some flavour of Microsoft SQL Server not PostGres - don't think MS SQL supports this.
Even so doing something inefficiently in a slightly more efficient way is probably going to be slower than doing efficiently just once.
Admin
Maybe I'm just dumb, but what does the beginning of the story have to do with the end?
What does a retarded table that is super slow to query have to do with the missing data?
Admin
I'm a sucker for such a challenge.. Just ran this SQL on my workstation
1000 selects by indexed NPI: 453ms 1000 selects by substring NPI: .. still waiting after 13 minutes
My workstation: Core quad Q6600, 8GB ram, sql 2005 64bit, running Vista x64, raid disk array, NOT a slow system. What the heck kind of laptop do you have that does the first in 30ms?
Admin
Agreed. Even if the table were fixed, I don't see how the missing number would magically appear, unless maybe it was missing due to column spacing. Did he ever find it? Inquiring minds want to know!
Admin
Admin
This supremely brilliant antithesis.
Admin
Admin
Could have been a materialised view with indexes. The view definition probably wouldn't have shown that.
Admin
My best guess is that they were still waiting on the record to show up after the previous night's import.
Admin
Admin
Admin
So... you left us hanging! What happened to the missing NPI number?
Admin
So, anyway, I got these Redundant Array of Independent Disks Arrays going and...
Admin
Wrong. CPU time is not what's important here. What's important is how long it takes to return the data.
If this is MS SQL, and it can't use indexes (preferably a clustered index seek), it has to do lots of disk I/O and a very small amount of CPU to find the right records. Performing disk I/O involves a lot of waiting time. That is measured by wall clock time, and not by CPU time.
David Walker
Admin
I would like to second that. While I don't know if it would make THAT big of a difference I find Vista's use of system resources appalling.
And my friends wonder what my problem is. . .
Captcha: populus. LOVE IT!
Admin
That's my NPI number!
Admin
Redundant RAID is actually a product. On extremely high-availability systems, you will have 2 separate mirrored arrays (each with their own inbuilt redundancy) running off of 2 separate controllers. This way if one of the controllers goes tits-up, you can failover to the other without being up the creek.
Admin
Well, it is to solve a little ambiguity. "I got a new RAID"... a new RAID what? A RAID card? A RAID cage? A RAID disk array? Understand yet?
Admin
Meh, It could be worse. Way worse.
Admin
Some bug spray.
Admin
I second these comments! Sure the database design is a huge WTF, but the story seems to be missing a punchline.
Admin
TRWTF is Grandpa Simpson posting WTF stories:
Admin
Clearly one that can calculate the average run time and not the total run time.
Admin
Admin
http://en.wikipedia.org/wiki/Litotes
Not a word I manage to work into conversation every day.
Admin
Gee, I didn't know health care providers had a federally-assigned ID. Now I have to add a column to my database table for that.
Admin
Can't believe someone hasn't noticed this yet.
That's over 9000 times as long!
Admin
Admin
The design of the table seems OK for the "import" (except that I would have added an "Error" column to track which rows have errors. That is the best way to do it so that you don't get DTS failing to import rows. Then a Stored Procedure can cycle through and process the just imported rows and build "the real table" with the data correctly parsed out. Those rows with errors can get flagged as such and the appropriate person (MORT) notified of the issues.
An alternative that was mentioned in a previous post is to create a materialized view on the table that gets regenerated after the import is completed. This 2nd method doesn't allow you to process errors as nicely.
Admin
Well, too bad for you that it's not a valid NPI! :P 1123581322, on the other hand, would be just fine.
Admin
How is it that the WTF's alternate between "so poorly edited the reader can't figure out what caused the initial problem" and "so heavily edited that the original submitter shows up to complain and correct the record?"
Admin
I don't know what the issue is, but I definitely clicked through thinking that the RSS feed had a truncated version of the story or something. Nope :(
We'll never know why the NPI number was missing.
(though actually my guess is that indeed it's some type of materialized view, and it's just stale)
Admin
I don't get it. Why are people making fun of my redundant RAID inexpensive disk array?
Admin
So...the WTF is that indexes are faster than table scans?
Yeah...hey, that sure is WTFy, alright.
Say, how is the view from the bottom of the barrel, anyway?
Admin
Was the view created a materialized view or not? While the underlying implementation is pretty crappy, a materialized view would get rid of all the performance problems and would be a really good reason for the dev in question to insist that people only use the view.
Admin
Looks like the table isn't the only thing missing a few lines.
Admin
I can't believe put everything into separate ROWS. A single cell would have sufficed, if he'd set it to NVARCHAR(Max). Sure you would use an extra delimiter per record, but you'd eliminate the table scan problem.
Admin
Admin
I suffer from RAS syndrome you insensitive clod!
Admin
One more vote for telling us what happened to the missing number.
Or is the start of the story just there to explain why the guy looked at the other guy's code?
Admin
I agree with this. How hard is it to explain what happened without either: a. Fictionalizing it so much that it is unbelievable b. Having it make no sense.
I miss the days when the DailyWTF was less "Story time with Alex" and more "Look at this bad code...make sure you're not dumb enough to do this!'
At least the Error'd and CodeSOD sections still speak for themselves.
Admin
Completely off-topic I know, but then again this story had no real ending so...
Admin
My thoughts as well. I've seen this before, and, yeah, it's a WTF. But what happened to the missing data?
Admin
Comment FTW!
Admin
Quoting original comment when replying FAIL!