Merge pull request #5103 from influxdata/jgm-null-tags

chore: explain null tags in primary keys
pull/5100/head
Jacob Marble 2023-08-24 12:56:33 -07:00 committed by GitHub
commit f6c7f3c014
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View File

@ -55,10 +55,13 @@ tags and fields.
- **Tags**: Key-value pairs that provide metadata for each point--for example,
something to identify the source or context of the data like host,
location, station, etc.
Tag values may be null.
- **Fields**: Key-value pairs with values that change over time--for example,
temperature, pressure, stock price, etc.
Field values may be null, but at least one field value is not null on any given row.
- **Timestamp**: Timestamp associated with the data.
When stored on disk and queried, all data is ordered by time.
A timestamp is never null.
<!-- _For detailed information and examples of the InfluxDB data model, see
[Data elements](/influxdb/v2.5/reference/key-concepts/data-elements/)._ -->
@ -78,6 +81,7 @@ The following definitions are important to understand when using InfluxDB:
- **Series**: A group of points with the same _measurement, tag keys and values, and field key_.
- **Primary key**: Columns used to uniquely identify each row in a table.
Rows are uniquely identified by their _timestamp and tag set_.
A row's primary key _tag set_ does not include tags with null values.
##### Example InfluxDB query results

View File

@ -586,6 +586,7 @@ The local server's nanosecond timestamp.
A data type that represents a missing or unknown value.
Denoted by the `null` value.
Values of [tags](#tag) and [fields](#field) may be `null`, but timestamp values are never `null`.
## O
@ -667,6 +668,7 @@ Related entries:
With the InfluxDB IOx storage engine, the primary key is the list of columns
used to uniquely identify each row in a table.
Rows are uniquely identified by their timestamp and tag set.
A row's primary key tag set does not include tags with null values.
### precision
@ -959,6 +961,7 @@ The collection of tag keys and tag values on a point.
Related entries:
[point](#point),
[primary key](#primary-key),
[series](#series),
[tag](#tag),
[tag key](#tag-key),

View File

@ -47,16 +47,20 @@ tags and fields.
- **Tags**: Key-value pairs that store metadata string values for each point--for example,
a value that identifies or differentiates the data source or context--for example, host,
location, station, etc.
Tag values may be null.
- **Fields**: Key-value pairs that store data for each point--for example,
temperature, pressure, stock price, etc.
Field values may be null, but at least one field value is not null on any given row.
- **Timestamp**: Timestamp associated with the data.
When stored on disk and queried, all data is ordered by time.
In InfluxDB, a timestamp is a nanosecond-scale [unix timestamp](#unix-timestamp) in UTC.
A timestamp is never null.
### Primary keys
In time series data, the primary key for a row of data is typically a combination of timestamp and other attributes that uniquely identify each data point.
In InfluxDB, the primary key for a row is the combination of the point's timestamp and _tag set_ - the collection of [tag keys](/influxdb/cloud-serverless/reference/glossary/#tag-key) and [tag values](/influxdb/cloud-serverless/reference/glossary/#tag-value) on the point.
A row's primary key _tag set_ does not include tags with null values.
### Tags versus fields