Shredding JSON columns gave Logfire up to 1000x faster queries

pydantic.dev

18 points by acossta 8 hours ago


Jean-Papoulos - 3 minutes ago

Re-discovering databases from first principles.

sgarland - 6 hours ago

It is hilarious to me when companies act like they've made some huge discovery that's been well-known to anyone working in DBs for the past decade, if not more.

JSON is slow as hell, both for serdes, and especially querying it. Use it sparingly, if at all. Normalization is not that hard, and it's trivial now with LLMs. Tell Claude you want your schema in BCNF, or 5NF if you're feeling froggy. Denormalize if and only if you have performance issues.

japgolly - 4 hours ago

> Rather than storing all attributes in a single JSON column, we automatically extract the most frequently accessed attributes into separate, strongly typed columns.

I'm glad they made the discovery but this is DB 101

MrThoughtful - 44 minutes ago

Why not store everything in a single json column but dynamically generate index files, so finding rows is fast?

Then you never have to change the data. Only the index files.

zX41ZdbW - 3 hours ago

This is quite an old technique. In ClickHouse, it appeared before it was named "shredding": https://github.com/ClickHouse/ClickHouse/issues/54864

drew0670 - 8 hours ago

[dead]

sans_souse - 8 hours ago

Let's just revert back 30 years and make the entire www plain text. What could possibly go wrong?