Re: jsonb and nested hstore

From: Greg Stark <stark(at)mit(dot)edu>
To: Oleg Bartunov <obartunov(at)gmail(dot)com>
Cc: Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Peter Geoghegan <pg(at)heroku(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Tomas Vondra <tv(at)fuzzy(dot)cz>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: jsonb and nested hstore
Date: 2014-03-13 12:42:00
Message-ID: CAM-w4HPwZCtjMr47Z0hH+uTx3ZuiTRhWSBwfiXwfAzBnRtaeTA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fwiw the jsonb data doesn't actually seem to be any smaller than text
json on this data set (this is avg(pg_column_size(col)) and I checked,
they're both using the same amount of toast space)

jsonb | json
-------+-------
813.5 | 716.3
(1 row)

It's still more than 7x faster in cpu costs though:

stark=# select count(attrs->'properties'->>'STREET') from citylots;
count
--------
196507
(1 row)

Time: 1026.678 ms

stark=# select count(attrs->'properties'->>'STREET') from citylots_json;
count
--------
196507
(1 row)

Time: 7418.010 ms

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2014-03-13 13:00:02 Re: inherit support for foreign tables
Previous Message Oleg Bartunov 2014-03-13 12:28:50 Re: jsonb and nested hstore