Influxdb: Question on 0.9x: How to edit measurements data ?

Created on 14 May 2015  路  5Comments  路  Source: influxdata/influxdb

What is the best way to edit a measurement in SQL ?
I know that the "UPDATE" command is not available but how to do it ?
i have a "serie" called access_log using strings:
time, website,category,username,MAC
how to update a field like:
UPDATE access_log SET username='something' WHERE MAC='64:b8:53:0f:a1:8d'

aredocumentation

Most helpful comment

Any point in the system is uniquely defined by:

  • the database.
  • retention policy.
  • measurement name.
  • timestamp.
  • tag key and values (if any).

If you send a point into the system, and a point already exists with those exact attributes, the point on disk will be overwritten. If it does not exist, it will be inserted.

@ericjmiller -- are you using a field or a tag for your "sequence" number? You should know that if it is a tag, that may have a very significant performance impact.

http://influxdb.com/docs/v0.9/concepts/schema_and_data_layout.html#tags-and-cardinality

All 5 comments

I usually create a json with 'time' and 'sequence_number' the exact same as the data point I want to update and add the new data. Then submit via HTTP API (python bindings). This replaces data in the series. There may be a better way.

Any point in the system is uniquely defined by:

  • the database.
  • retention policy.
  • measurement name.
  • timestamp.
  • tag key and values (if any).

If you send a point into the system, and a point already exists with those exact attributes, the point on disk will be overwritten. If it does not exist, it will be inserted.

@ericjmiller -- are you using a field or a tag for your "sequence" number? You should know that if it is a tag, that may have a very significant performance impact.

http://influxdb.com/docs/v0.9/concepts/schema_and_data_layout.html#tags-and-cardinality

I believe this is answered, closing this, though the mailing list is the preferred place for questions. Github issues are really only for bug reports and feature requests.

So my feature requests is to explain or point to the right place for the best way to do it here:
https://github.com/influxdb/influxdb/blob/master/QUERIES.md

@otoolep I believe @ericjmiller is likely on 0.8.x, which had an internal sequence number. The behavior is the same in 0.8 and 0.9, in that a newly written point will silently overwrite a previous point. In 0.8 the uniqueness of a point is determined by the series name, the timestamp, and the sequence number. In 0.9 the uniqueness of a point is determined by the measurement, the timestamp, and the tag set.

@dtouzeau thank you for your request to improve the documentation. I'll take this as an issue for the queries.md page, but please open further documentation requests on the influxdb/influxdb.org repo.

Was this page helpful?
0 / 5 - 0 ratings