
## Metadata
- Author: [[randy-from-counting-stuff|Randy From Counting Stuff]]
- Full Title:: Everyone Fears the Cartesian
- Category:: #🗞️Articles
- Document Tags:: [[sql|Sql]], [[sql|Sql]],
- Finished date:: [[2023-08-09]]
## Highlights
> The problem with such key-value arrays is that they’re intended to be catch-all fields. They’re to put miscellaneous one-off logging data for when it’s not reasonable to modify the schema for. Devs use them as arbitrary-length data stores and can shove as many key-value pairs in as they want, even change the contents of existing fields without notice. Just because a query is well behaved and has a 1-to-1 mapping for joining today doesn’t guarantee that some creative future change won’t break things and turn it into a 1-to-many relationship later. ([View Highlight](https://read.readwise.io/read/01h7ddxs9pqyh9kvx989941mn1))
> As far as I can tell, some variation of this mishap has happened to every single person that regularly uses SQL to report things ([View Highlight](https://read.readwise.io/read/01h7ddyv48413e35azb8vvb7hz))
> So the backup strategy is to just sidestep the duplicates by counting distinct items instead ([View Highlight](https://read.readwise.io/read/01h7de3edrn2f1qx5xan166sby))