Bad Database Design Spotlight
Posted: Tue May 21, 2019 6:25 am
I hate bad database design. Today's spotlight is on Eaglesoft.
I was dumping the database to SQLite and noticed that after a few tables, it stopped at one called "daily_patient_productivity_view". It spent hours dumping this one table, so I went home for the day.
Interested to see what it was, turns out that every day it stores a record for every single patient as to if they have had any credits or debits. Every single patient. Every day.
In this case, there were over 14 million records of :
Day Number | Patient | Debits | Credits
421 142 0.00 0.00
421 143 0.00 0.00
Not to be discouraged by a bad design, they also had an extra 14 million records in "daily_referral_productivity_view" AND another 14 million in "daily_service_productivity_view".
Removing only the records that had no data reduced the database from 1500MB to 250MB.
Bad designs like this slow down your server, make backup's take longer and take up more space, make generating reports take longer, and generally just show ignorance of the developer or apathy for the results on the customer.
Open Dental FTW
I was dumping the database to SQLite and noticed that after a few tables, it stopped at one called "daily_patient_productivity_view". It spent hours dumping this one table, so I went home for the day.
Interested to see what it was, turns out that every day it stores a record for every single patient as to if they have had any credits or debits. Every single patient. Every day.
In this case, there were over 14 million records of :
Day Number | Patient | Debits | Credits
421 142 0.00 0.00
421 143 0.00 0.00
Not to be discouraged by a bad design, they also had an extra 14 million records in "daily_referral_productivity_view" AND another 14 million in "daily_service_productivity_view".
Removing only the records that had no data reduced the database from 1500MB to 250MB.
Bad designs like this slow down your server, make backup's take longer and take up more space, make generating reports take longer, and generally just show ignorance of the developer or apathy for the results on the customer.
Open Dental FTW