Hacker News new | ask | show | jobs
by greenlet 3546 days ago
how does mysql's json type compare to postgres' jsonb? my biggest gripe with both of them is lack of partial update
2 comments

No partial update yet, but we are working towards it -

The json binary format spec allows for padding. Search in page for 'BLOB' for details: http://mysqlserverteam.com/the-mysql-8-0-0-milestone-release...

jsonb_set is available now in postgres 9.5: https://www.postgresql.org/docs/9.5/static/functions-json.ht...
but that's not partial update. this will update the entire document(blob).
Postgres' MVCC architecture makes the idea of 'partial updates' kind of meaningless. An update to any postgres column is equivalent to a DELETE followed by an INSERT and will result in a new row on disk, leaving the old row to be vacuumed later.
Just to clarify: s/architecture/implementation/

InnoDB is MVCC too, but does an update in place with relocation of the old row to UNDO space. There are pros and cons to both approaches.