I double-checked my queries. Had I goofed in my sql? Nope. Next, I looked into if some of the data was in an inconsistent state.
What I found was worse than what I’d imagined. As a data person, it made me feel sad and icky.
That’s because it’s usually not too hard to clean up bad data. It’s almost always much harder to fix a badly designed data model which is already established in production.
Read on for a tale as old as time: the clarion call of expediency now causing pain later.