On 21.02.2020 15:03 Richard Hipp wrote: > On 2/21/20, Wout Mertens <wout.mert...@gmail.com> wrote: >> The idea is that upon storing the JSON >> data, the JSON1 extension parses it, extracts the layouts recursively, >> stores them when they are not known yet, and then only stores the >> values in the binary format with the layout identifiers. > I experimented with a number of similar ideas for storing JSON when I > was first designing the JSON components for SQLite. I was never able > to find anything that was as fast or as compact as just storing the > original JSON text. But I could have overlooked something. If you > have example code for a mechanism that is more space efficient and/or > faster, please share it with us.
If you want to be as space efficient as possible, look into succinct data structures. The balanced parenthesis representation of a tree can be stored in a bit vector (each node 2 bits) and there are (succinct) index structures to query that efficiently. See e.g. https://core.ac.uk/download/pdf/81941172.pdf and https://github.com/simongog/sdsl-lite/blob/master/include/sdsl/bp_support_g.hpp as an implementation. Making this work with JSON would be a lot of work, though, I guess. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users