Question

I have the following columns:

'datetime', - which gives the time when the sensor values are recorded.

'machineID', - which gives the machine ID of the machine from where the sensor values are recorded.

'volt', 'rotate', 'pressure', 'vibration' - 4 different sensor values measured for a particular Machine at a time.

Please let me know if I need to name datetime and MachineID coulumns under tag or fields.

Thank you in advance.

Was it helpful?

Solution

You can take a call considering below two scenarios.

  1. If you need to run a GROUPBY clause on a particular column/field, then you need to create it as Tag, otherwise you won't be able to use GROUPBY clause.

  2. Indexing: Fields cannot be indexed in influxdb. Tag are automatically indexed.

Also, influx by default creates a 'time' tag, so it's better while inserting you pass the value to 'time' instead of adding an extra column called 'datetime'

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top