Better HN
topnewbestaskshowjobs
Log inSign up

magnush

20 karma · joined Mar 24, 2014 (12y ago) · 5 submissions

Submissions

comment 12y ago · link · parent

Probably the most important difference is that the old JSON types preserves whitespace and attribute ordering, whereas the new one doesn't. If you don't care about those, the old one is also slightly smaller on disk - but I would say not worth it based on the simple fact that you might want to search it in the future some time...

comment 12y ago · link · parent

Another important part about gist is that GIN has much higher overhead for tables that are frequently updated.

comment 12y ago · link · parent

One important difference is that you don't need to extract the values to create an index. E.g. in Mongo I believe you still have to decide which keys to index. A GIN index on top of jsonb in PostgreSQL will make it possible to do an indexed search on any key, not just those that are specified at create index time.

comment 12y ago · link · parent

PostgreSQL jsonb has the same problem in the actual document storage, with repeated keys. I believe it does better in the index, when you use the correct operator, but the table storage has the same type of overhead.

comment 12y ago · link · parent

No, jsonb will still update the whole value when you edit it. For now at least.