Versions Compared

Key

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

...

TypeField SizeDefault ValueDescription
Int810 1-byte signed integer
Int161, 20 2-byte signed integer, but may occupy less space due to compression mechanism described below

Int32

1, 2, 40 4-byte signed integer, but may occupy less space due to compression mechanism described below
Int641, 2, 4, 80 8-byte signed integer, but may occupy less space due to compression mechanism described below
Float40.0 4-byte floating-point number
Float40.0Double4, 80.0 8-byte floating-point number, but may occupy less space due to compression mechanism described below
Numbervariable0 Variable-length integer
Decimalvariable0Decimalvariable0 Variable-length fixed-point number, the scale is determined by the schema though it is stored with the number
UUID1600000000-0000-0000-0000-000000000000UUID
Stringvariableempty stringAn utf-8 encoded string
Binaryvariableempty binaryVariable-length arbitrary binary data
Bitmaskvariableempty bit-stringVariable-length binary data representing a bit-string
Date3

Jan 1, 1 BC for date   (1 BC immediately precedes 1 AD in the Gregorian calendarprecedes

1 AD in the Gregorian calendar)

A timezone-free date (a year, month, day)
Time4, 5, 600:00:00.000000 A timezone-free time (hour, minute, second, microseconds)
DateTime7, 8, 9Jan 1, 1 BC, 00:00:00.000000 A timezone-free datetime encoded as (date, time)
Timestamp8, 12, 12Jan 1, 1970, 00:00:00.000000 Number of microseconds since Jan 1, 1970 00:00:00.000000 (with no timezone)
Duration8, 120  (PT0S)See below
Period3, 6, 120  (P0D)See below
Boolean1false 

...

A boolean value (either true  of false  )

Integer Representation

All integer values are stored in the little-endian byte order.

Uniform use of offset tables for all fields lets us take advantage of variable-length principle for integer fields.

little-endian byte order.

For Thus for integer values it is possible to keep only their significant bytes, omitting their high insignificant bytes. That is even if the original data type of a field is INTEGER and should occupy 4 bytes but the actual value is below 128  and above -129  then we can store it just as a single byte and reflect this in the offset table.

...

In SQL standard there are no unsigned integers. So their support may be is omitted for now. But should it become needed for some reason then a compressed unsigned integer must be zero-extended on decompression.

...

Unlike Date, every part is independent from others and can be in range from Integer.MIN_VALUE to Integer.MAX_VALUE.

Boolean Representation

A single byte containing 1  for the value of true. The value of false does not need any representation as it stored as a default zero-size field.

Corollary

If the number of fields is N and t is an array that stores a binary tuple we can find the answers for the following:

...