Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To the contrast, indexing engine usually read fields in random order with O(N) complexity on average.

We In Ignite 1.5 we need to change the protocol so that field position could be found in ~O(1) on average.

Protocol 

The following changes are proposed:

  • FIeld IDs and lengths are moved to object footer.
  • Relative footer offset is added to object header.
  • All field IDs are hashed in order they are written. Resulting value is saved to object header. We refer to is as *schema ID*.

Resulting object layout (unrelated header pieces are ommited):

[0   .. 4   ] - Footer offset; could be zero if the whole object is written in raw mode.
[4   .. 8   ] - Schema ID. Absent in case footer offset is zero.
[8   .. X   ] - Field 1.
[X   .. Y   ] - Field 2.
[Y   .. Y+4 ] - Footer start, field 1 ID. 
[Y+4 .. Y+8 ] - Field 1 offset.
[Y+8 .. Y+12] - Field 2 ID, etc.

Implementation details