News for hackers. Stuff that matters.
Re:PostgreSQL: Jsonb has committed by optimiz3 on Monday March 24, 2014 @10:32AM (#7458394)
Can anyone comment on the storage overhead of JSONB key names? One of the worst things about MongoDB's BSON format is that 8M instances of the following record:

{ "user": "test", "isValid": true }

will at a minimum cost 8M * (4 + 7) simply due to field name overhead. MongoDB isn't smart enough to alias common field names, and this has remained as one of its biggest problems.

https://jira.mongodb.org/browse/SERVER-863

Re:PostgreSQL: Jsonb has committed by subleq on Monday March 24, 2014 @01:33PM (#7459693)
If only there were a way to store data where each record has the same structure...

The JSON support in postgres allows a hybrid approach. Put the common data in a tabular format, with a JSON column that stores all the extra, variable data.

Re:PostgreSQL: Jsonb has committed by optimiz3 on Monday March 24, 2014 @06:40PM (#7462238)
Internal pseudo-schematized data storage and JSON support aren't mutually-exclusive. Nice to have a checkbox feature like this but the implementation isn't particularly exciting for large datasets.
Re:PostgreSQL: Jsonb has committed by magnush on Monday March 24, 2014 @10:53AM (#7458518)
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.
Re:PostgreSQL: Jsonb has committed by rpedela on Monday March 24, 2014 @10:56AM (#7458544)
This email talks about how the indexes are 50% the size of the data.

http://www.postgresql.org/message-id/5323D45F.1080503@agliod...

Re:PostgreSQL: Jsonb has committed by Tobu on Monday March 24, 2014 @01:25PM (#7459629)
Document stores trade off some performance and robustness to increase ease of development. When that becomes a problem you can switch to more structured tables. One possibility is to structure frequently accessed fields and stuff the remainder into a json column.
Re:PostgreSQL: Jsonb has committed by optimiz3 on Monday March 24, 2014 @06:33PM (#7462180)
This just forces complexity onto the caller - it's not unreasonable to expect the DB to "pseudo-schematize" as most keys will be repeated.
Re:PostgreSQL: Jsonb has committed by Tobu on Tuesday March 25, 2014 @06:00AM (#7464852)
With a power law, only a few keys occur frequently. Changing the data representation implicitly would cause unpredictable performance as columns get rewritten. If you want to do more explicit storage optimisations, maybe one of the mongo-like overlays could accommodate that.
Re:PostgreSQL: Jsonb has committed by optimiz3 on Tuesday March 25, 2014 @10:54AM (#7466205)
It's more than that - virtually large all datasets I've worked with (> 20B documents) had a keyspace of under 128 keys/columns per nested level of a JSON document. Meaning an optimizing DB could express most keys as single byte (or less with packing). I don't thing column reordering would be necessary unless you exhausted the first 128 keys and you wanted to optimize the base-128 keyspace assignment. Such an operation could be done during compaction or any other operation that rewrites a table.