JSON columns cut query speed for cross-order reads in SQLite and D1, study finds
A developer compared storing 50,000 orders as normalised tables versus a single JSON or JSONB column in SQLite. Reading one order by id performed about the same in both designs, which explains why the document approach feels cheap. The document format was about 1.3 times larger on disk because JSON repeats key names for every line item, and JSONB reduced that overhead only partly. Queries that aggregate or filter across many orders ran between roughly 3 and 18 times slower against the document shape. The author measured these results on SQLite 3.46.1 and, where possible, on Cloudflare D1.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in