Description
Hello.
I am trying to evaluate ZSON to store some metadata (as one of many columns in PG table), that should be very well suited for ZSON
- table has 200k rows
- json column uses 50MB of disk space, average size is 327 (some are null)
- dev environment - data are very repetitive (see later), i'm not fiddling with prod ofc.
Steps:
- Performed steps from Install section
- Ran zson_learn with defaults on a jsonb column of a table. The whole dictionary consists of 28 rows.
- Altered table to add a column of zson type
- Ran update table, to set zson_column to be jsonb_to_zson(original_column)
The problem is, that according to pg_column_size, the zson column is 7% larger compared to jsonb type.
Also, if I run zson_info, the result is no different
zson version = 0, dict version = 0, jsonb size = 327, zson size (without pglz compression) = 349 (106.73%)
zson version = 0, dict version = 0, jsonb size = 324, zson size (without pglz compression) = 362 (111.73%)
zson version = 0, dict version = 0, jsonb size = 331, zson size (without pglz compression) = 349 (105.44%)
The json looks lite this:
{ "variables": [ { "type": "ComplexValue", "variableCode": "oneOfVeryFewKeyTypes", "variableValue": [ { "type": "StringValue", "variableCode": "otherOfVeryFewKeyTypes", "variableValue": "oneOf20Values" }, { "type": "StringValue", "variableCode": "otherOfVeryFewKeyTypes", "variableValue": "anotherOf20Values" } ] } ], "schemaVersion": "v4" }
What I am doing wrong?
Thanks in advance.