forked from eldersantos/community
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated description of short strings and added description of short a…
…rrays Updated record sizes in the cache section
- Loading branch information
1 parent
c205da7
commit 23fb825
Showing
4 changed files
with
63 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[[short-arrays]] | ||
Compressed storage of short arrays | ||
=================================== | ||
|
||
Neo4j will try to store your primitive arrays in a compressed way, so as to save disk space and possibly an I/O operation. | ||
To do that, it employs a "bit-shaving" algorithm that tries to reduce the number of bits required for storing the members | ||
of the array. In particular: | ||
|
||
1. For each member of the array, it determines the position of leftmost set bit. | ||
2. Determines the largest such position among all members of the array | ||
3. It reduces all members to that number of bits | ||
4. Stores those values, prefixed by a small header. | ||
|
||
That means that when even a single negative value is included in the array then the natural size of the primitives will be used. | ||
|
||
There is a possibility that the result can be inlined in the property record if: | ||
|
||
* It is less than 24 bytes after compression | ||
* It has less than 64 members | ||
|
||
For example, an array long[] {0L, 1L, 2L, 4L} will be inlined, as the largest entry (4) will require 3 bits to store so the whole array will be stored in 4*3=12 bits. The array long[] {-1L, 1L, 2L, 4L} | ||
however will require the whole 64 bits for the -1 entry so it needs 64*4 = 32 bytes and it will end up in the dynamic store. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters