This document doesn't replace documentation relevant to the database software you are
using, ie. README.mysql, README.pgsql or README.sqlite3.

The 'timestamp_start' and 'timestamp_end' fields.
Such fields are being introduced to support logging of traffic and events via pmacct.
Timestamps resolution is up to the msec level reason for which two additional fields
are optionally introduced aswell 'timestamp_start_residual', 'timestamp_end_residual':
this is because support for resolutions beyond the secs level is something not popular
among the supported RDBMS, ie. only recent versions of MySQL >= 5.6.4 appear to support
it, hence the choice to go for two separate fields. Timestamp resolution can be cut to
secs level by setting timestamps_secs config directive to 'true': in this case the two
fields timestamp_start_residual, timestamp_end_residual can be indeed omitted in the
table schema. The guidelines below (typically in MySQL format) are to add all the
described primitives to the SQL schema:

* timestamp_start and timestamp_start_residual fields:
  - To declare the fields:
    - "timestamp_start DATETIME NOT NULL,"
    - "timestamp_start_residual INT UNSIGNED NOT NULL,"
  - To add them to the primary key:
    - "PRIMARY KEY (..., timestamp_start, timestamp_start_residual, ...)"

* timestamp_end and timestamp_end_residual fields:
  - To declare the fields:
    - "timestamp_end DATETIME NOT NULL,"
    - "timestamp_end_residual INT UNSIGNED NOT NULL,"
  - To add them to the primary key:
    - "PRIMARY KEY (..., timestamp_end, timestamp_end_residual, ...)"

The primitive is not declared as part of any default table version; yet will not fail
version checks which are enabled when 'sql_optimize_clauses' feature is disabled.
