Skip to content

Actual space consumption higher despite repetitive nature #26

Closed
@tomas0svk

Description

@tomas0svk

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:

  1. Performed steps from Install section
  2. Ran zson_learn with defaults on a jsonb column of a table. The whole dictionary consists of 28 rows.
  3. Altered table to add a column of zson type
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions