3 ms·
Like with most performance questions, it depends. I see someone else said that it scaled well for sqlite. For postgres, it very much depends. Building a json o
by mplanchard 3y ago
Like with most performance questions, it depends.
I see someone else said that it scaled well for sqlite. For postgres, it very much depends. Building a json object is much, much slower than selecting a row. Updating JSON objects involves building a new one, since you need to replace the entire object, so avoid building your schema in a way that requires updating JSON objects.
(Experience is with postgres 14. To be fair, performance was generally fine up until the 100s of millions of rows)
JSON query performance in postgres though is generally quite good. If you have static data, throwing it into a JSONB column with a jsonb_path_ops GIN index (or the default if you need the extra query flexibility) scales well up to billions of rows.
- netcraft 3y agobuilding a json object is slow compared to returning rows. but its far faster than multiple trips to the database to build a json object in the application layer.