Documentation

Handle duplicate data points

InfluxDB identifies unique data points by their measurement, tag set, and timestamp (each a part of Line protocol used to write data to InfluxDB).

web,host=host2,region=us_west firstByte=15.0 1559260800000000000 --- ------------------------- -------------------  | | | Measurement Tag set Timestamp

Duplicate data points

For points that have the same measurement name, tag set, and timestamp, InfluxDB creates a union of the old and new field sets. For any matching field keys, InfluxDB uses the field value of the new point. For example:

# Existing data point web,host=host2,region=us_west firstByte=24.0,dnsLookup=7.0 1559260800000000000  # New data point web,host=host2,region=us_west firstByte=15.0 1559260800000000000

After you submit the new data point, InfluxDB overwrites firstByte with the new field value and leaves the field dnsLookup alone:

# Resulting data point web,host=host2,region=us_west firstByte=15.0,dnsLookup=7.0 1559260800000000000
from(bucket: "example-bucket")  |> range(start: 2019-05-31T00:00:00Z, stop: 2019-05-31T12:00:00Z)  |> filter(fn: (r) => r._measurement == "web")  Table: keys: [_measurement, host, region]  _time _measurement host region dnsLookup firstByte -------------------- ------------ ----- ------- --------- --------- 2019-05-31T00:00:00Z web host2 us_west 7 15

Preserve duplicate points

To preserve both old and new field values in duplicate points, use one of the following strategies:

Add an arbitrary tag

Add an arbitrary tag with unique values so InfluxDB reads the duplicate points as unique.

For example, add a uniq tag to each data point:

# Existing point web,host=host2,region=us_west,uniq=1 firstByte=24.0,dnsLookup=7.0 1559260800000000000  # New point web,host=host2,region=us_west,uniq=2 firstByte=15.0 1559260800000000000

It is not necessary to retroactively add the unique tag to the existing data point. Tag sets are evaluated as a whole. The arbitrary uniq tag on the new point allows InfluxDB to recognize it as a unique point. However, this causes the schema of the two points to differ and may lead to challenges when querying the data.

After writing the new point to InfluxDB:

from(bucket: "example-bucket")  |> range(start: 2019-05-31T00:00:00Z, stop: 2019-05-31T12:00:00Z)  |> filter(fn: (r) => r._measurement == "web")  Table: keys: [_measurement, host, region, uniq]  _time _measurement host region uniq firstByte dnsLookup -------------------- ------------ ----- ------- ---- --------- --------- 2019-05-31T00:00:00Z web host2 us_west 1 24 7  Table: keys: [_measurement, host, region, uniq]  _time _measurement host region uniq firstByte -------------------- ------------ ----- ------- ---- --------- 2019-05-31T00:00:00Z web host2 us_west 2 15

Increment the timestamp

Increment the timestamp by a nanosecond to enforce the uniqueness of each point.

# Old data point web,host=host2,region=us_west firstByte=24.0,dnsLookup=7.0 1559260800000000000  # New data point web,host=host2,region=us_west firstByte=15.0 1559260800000000001

After writing the new point to InfluxDB:

from(bucket: "example-bucket")  |> range(start: 2019-05-31T00:00:00Z, stop: 2019-05-31T12:00:00Z)  |> filter(fn: (r) => r._measurement == "web")  Table: keys: [_measurement, host, region]  _time _measurement host region firstByte dnsLookup ------------------------------ ------------ ----- ------- --------- --------- 2019-05-31T00:00:00.000000000Z web host2 us_west 24 7 2019-05-31T00:00:00.000000001Z web host2 us_west 15

The output of examples queries in this article has been modified to clearly show the different approaches and results for handling duplicate data.


Was this page helpful?

Thank you for your feedback!


New in InfluxDB 3.5

Key enhancements in InfluxDB 3.5 and the InfluxDB 3 Explorer 1.3.

See the Blog Post

InfluxDB 3.5 is now available for both Core and Enterprise, introducing custom plugin repository support, enhanced operational visibility with queryable CLI parameters and manual node management, stronger security controls, and general performance improvements.

InfluxDB 3 Explorer 1.3 brings powerful new capabilities including Dashboards (beta) for saving and organizing your favorite queries, and cache querying for instant access to Last Value and Distinct Value caches—making Explorer a more comprehensive workspace for time series monitoring and analysis.

For more information, check out:

InfluxDB Docker latest tag changing to InfluxDB 3 Core

On November 3, 2025, the latest tag for InfluxDB Docker images will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments.

If using Docker to install and run InfluxDB, the latest tag will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments. For example, if using Docker to run InfluxDB v2, replace the latest version tag with a specific version tag in your Docker pull command–for example:

docker pull influxdb:2

InfluxDB Cloud powered by TSM