CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Darrell Norton's Blog [MVP]

Fill in description here...

My Worst Database Experience Ever

Roy is talking about database sins.  I worked on porting one database that had to be the worst I’ve ever seen in my entire career.

First off, it was an Access database.  It starts off well doesn’t it?  J  Well, it was an Access database split into two parts (the front file and the back file), each a couple hundred MB each.  And they used the ldb locking file to manage roles, passwords, etc.  Great huh?  It gets better.

There were 100 tables or so.  Some were in the front file, some were in the back file, some were in both and were not linked tables!

There was not one relation in the entire database!

One table held 5 different types of objects.  True they were related to each other, but not the same.  The VBA code was littered with if(type = A) then do x elseif (type=B) then do y etc.

All forms would select * from tableName, even if the form only needed one value.  Oh, and it did this with the table that held 5 different types of objects (which were the centerpiece of the domain model, thus there were lots of records in the table), so some forms took 2 minutes to open while it selected the entire table, and then filtered the results to typeA only and then displayed 5 of the fields!

And beside the primary key identifier on some of the tables (some tables had none), all fields were nullable!  There were probably 25,000 IsNull checks in the VBA code.

There was more, but the rest was peanuts compared to this!



Comments

Thomas Tomiczek said:

I may have a better one.

"moron designed access db" handling invoicing.

In order not to have the invoice tables getting too long, the system generated TWO new tables per invoice (invoice, invoicedetails). The poor customer had thousands of tabls in there with 1 (invoice) and a handfull (invoicedetail) lines each.

Naturally you needed to query all these pretty often in a uniform way, so the "create new invoice" method also updates a cascade (one was not enough) of queries which features a JOIN.

Performance was interesting. Yeah, Really interesting.

I suppose some people are just too stupid for their job in IT.
# February 19, 2004 2:00 AM

Darrell said:

Steve - yes, I love Access databases like I love hangnails. :)
# February 19, 2004 2:27 AM

Darrell said:

Thomas - ooh, nice one with the table-per-invoice theory. Pretty impressive display of ignorance there. You know, it's people like that that make it easy for consultants to look good.
# February 19, 2004 2:28 AM

Roy Osherove said:

ack! is all I can say. Still, I have more sins to come. One of them involves two big methods named... yep, "Doit" and "DoIt1".
# February 19, 2004 2:52 AM

Donny Mack said:

Post not about SQL Server, but Let's Make it!
# February 19, 2004 3:46 AM

Darrell said:

Roy - hehehe, the infamous "DoIt" methods, with a number tacked on for every new version needed. It ranks right up there with calling all of your variables myVariable1, myVariable2, etc. :)
# February 19, 2004 4:26 AM

Mark Bonafe said:

Ahhh. You have a whole new appreciation for Access now. Don't you Darrell?
# February 19, 2004 7:52 AM

Mark Bonafe said:

XTreme Best Practices
# February 19, 2004 10:43 AM

Avonelle Lovhaug said:

The icky project I tried to clean up had variables named the following:

- mess
- Ben
- Mark
- Jesus

At first, I thought it was for the former programmers, but I doubt that Jesus was working on this particular effort.
# February 19, 2004 11:31 AM

Thomas Tomiczek said:

::At first, I thought it was for the former
::programmers, but I doubt that Jesus was
::working on this particular effort.

This was just the wishfull thinking hoping for some wonder to save the butts of the incompetnt dudes working there before you.

They WISHED Jesus would come along and hlp them :-)
# February 19, 2004 12:20 PM

Enjoy Every Sandwich said:

Take Outs: The Digital Doggy Bag of Blog Bits for 18th and 19th February 2004
# February 19, 2004 5:10 PM

Darrell said:

Avonelle - yeah, Jesus would never have supported that architecture, right?

Instead of turning water into wine, maybe he could turn bad code into good? :)
# February 20, 2004 2:55 AM
Check out Devlicio.us!