0.3.0¶
Release type: partial read path.
Purpose¶
This release changes how jsonb_slice_get(jsonb, text) reads a stored JSONB
value. The function uses TOAST slices when the input is external and
uncompressed. The SQL signature and result rules do not change.
Read path¶
The partial path reads these byte ranges:
- the root header;
- the top-level entry directory;
- all top-level key bytes;
- the selected value bytes, when the key exists.
The function uses a binary search on the top-level keys. Inline and compressed values use PostgreSQL's normal complete-value path.
Verification¶
The regression test compares the result with PostgreSQL's jsonb -> text
operator. It covers every JSONB value type, missing keys, empty keys, and
multibyte text. It checks the first, middle, and last key positions. It also
checks length-first key ordering and JEntry positions across an offset stride.
External arrays and scalars verify the non-object path. A test-only counter
shows that the requested slice lengths total less than the complete external
test value.
Boundary¶
This release supports one top-level text key. The selected value can be an object or an array, so the function can read the complete selected value. The release is an experiment and makes no general performance claim.