Impact of tag length in performance

Hi all.

We need to store data in influx with very long string tag, I’d like to know how is the size of the tag impacting in the performance of queries and growth of DB size.

For instance, let’s imagine I want to store a metric with the following tags:

customerid=121
monitorid=LKRWE30240934JKJEDF093SJDFSDKJLF93049234JSDJFKJSDF923RFJSDJFL09R4398JRSLFKJSDF4908435JFJSLKFJ904JFS

And then some values like:
exectime=12
status=6
cpu=70

So, my concerns are:

  • Are the tags stored multiple times (i.e. one per sample) or just once?
  • Is the size of the tag impacting in the query? So, for instance quering by the customerid will work better than for monitorid? Or is the tag size not impacting at all?

Thanks!

Hi!

A tag is only stored once. Database names, measurements, tag keys, field keys, and tag values are stored only once and always as strings. Only field values and timestamps are stored per-point.

Non-string values require approximately three bytes. String values require variable space as determined by string compression.

While the strings may affect overhead, overall they will have much less impact than other big factors like cardinality.

2 Likes

This is great information, is it documented somewhere?