My InfluxDB version is 2.0.8, released about two years ago.
The query peroformance of that version is really low, about 1/10 or 1/100 compared with verision 1.7 or former, e.g.
cost 3.46 seconds setup streams and 11.63 seconds to download (4820, 35)results
cost 16.05 seconds setup streams and 11.65 seconds to download (4819, 35)results
such performance can not even be called REAL-TIME Database, worse even compared with MySQL such Relational Database, really a joke.
My Question is that whether our developer has found the root-cause and have done the necessary enhancement so the performance now is similar to version 1.7 or better?
#|> filter(fn: (r) => r["_field"] == "last_price" or r["_field"] == "low_price" or r["_field"] == "high_price" or r["_field"] == "close_price" or r["_field"] == "down_price")
if len(fields) > 0:
query += '|> filter(fn: (r) => '
i = 0
for ie in fields:
if i > 0:
query += ' or '
query += 'r["_field"] == "' + ie + '"'
i += 1
query += ')'
query += '|> pivot(rowKey:["_time"], columnKey: ["_field","_measurement"], valueColumn: "_value")'
t0 = time.time()
client = InfluxDBClient(url=url, token=token, org=org, timeout = QUERY_TIME_OUT)
query_api = client.query_api()
# 方法四遍历一个月数据15秒并重组
result = query_api.query_raw(query, dialect=Dialect(header=True, delimiter=","
, comment_prefix="#", annotations=[],
date_time_format="RFC3339"))