Skip to content

Calculation example for data consumption

You can calculate how many GB of memory are required for which data points.

Validity

This information applies only to retaining the data and reading historical data. It does not apply to reading the live data.

Calculation formula

The calculation formula is made up as follows:

$\text{ database size} = \text{number of variables} \times \text{ value per variable} \times \text{ data type size}$

The data type size results from the addition of:

  • Time stamp 8 bytes
  • Quality code 2 bytes
  • Value
    • Bool 1 byte
    • (U)Int8 1 byte
    • (U)Int16 2 bytes
    • (U)Int32 4 bytes
    • (U)Int64 8 bytes
    • Float 4 bytes
    • Double 8 bytes
    • String, depending on length and contained characters: 1 byte (single character) to 4 bytes (UTF-8) per character

Example

5 millisecond cycle:
$200 \text{ values per second}$

8 hours of storage time:
$200 \times (60 \times 60 \times 8) = 5,760,000 \text{ values per variable (5.76 million)}$

90 Int32 variables:
$(8 \text{ bytes (time stamp)} + 2 \text{ bytes (quality code)} + 4 \text{ bytes (Int32)}) \times 5,760,000 \text{ values per variable} \times 90 \text{ variables} = 7,257,600,000 \text{ bytes} = 6921 \text{ MB} = 6.76 \text{ GB}$