Skip to content
jsonW Paper GitHub

File layout

Key index: straight to the row, no scan

The format has an index that leads to a key's row without reading the file. In the public tool, keys show up in the comparar command.

· jsonW 1.3.11

The problem

Finding a record by its code, such as a SKU or an order number, in a data file means scanning everything or loading the file into a database just to get an index.

How jsonW solves it

The format defines a key index that leads straight to the row. The visible use of keys today is comparar, which matches the rows of two files by a column and counts what was added, removed and changed.

$ wjsw comparar ontem.jsw hoje.jsw sku
so em a 1 · so em b 1 · mudou 1 · iguais 0 (0.0 ms)

Real output of comparar between two files, by the sku column.

Where it is

The index exists in the core, but in version 1.3.11 it has no command in wjsw and no function in the public ABI. The paper says so in Section 8, and so does this post: when it gets a command, it will show up here with real output.

Read the full section in the paper →