InfluxDB v2.0 returns query results just one field by one field with all query inforamtion and measurement, tags, why not packed them together like writing? so it cost 300 seconds for just 10,000 records with about 25 fields, the results is 250,000 records! so can do it a little smarter?..
I just want a csv like table or mysql like table returns.
query code:
client = InfluxDBClient(url=“http://localhost:18086”, token=token, org=org)
query_api = client.query_api()
#result = query_api.query(org=org, query=query)
#result = query_api.query_stream(org=org, query=query)
result = query_api.query_csv(query)
return:
the 16827 record: FluxRecord() table: 78, {‘result’: ‘_result’, ‘table’: 78, ‘_start’: datetime.datetime(2021, 9, 11, 17, 1, 38, 152518, tzinfo=tzutc()), ‘_stop’: datetime.datetime(2021, 9, 13, 17, 1, 38, 152518, tzinfo=tzutc()), ‘_time’: datetime.datetime(2021, 9, 13, 5, 42, 44, 780000, tzinfo=tzutc()), ‘_value’: 7000, ‘_field’: ‘ask1_vol’, ‘_measurement’: ‘510050’, ‘mkt’: ‘SH’, ‘status’: ‘T’, ‘type’: ‘S’}
the 16828 record: FluxRecord() table: 78, {‘result’: ‘_result’, ‘table’: 78, ‘_start’: datetime.datetime(2021, 9, 11, 17, 1, 38, 152518, tzinfo=tzutc()), ‘_stop’: datetime.datetime(2021, 9, 13, 17, 1, 38, 152518, tzinfo=tzutc()), ‘_time’: datetime.datetime(2021, 9, 13, 5, 42, 47, 780000, tzinfo=tzutc()), ‘_value’: 83800, ‘_field’: ‘ask1_vol’, ‘_measurement’: ‘510050’, ‘mkt’: ‘SH’, ‘status’: ‘T’, ‘type’: ‘S’}
the 16829 record: FluxRecord() table: 78, {‘result’: ‘_result’, ‘table’: 78, ‘_start’: datetime.datetime(2021, 9, 11, 17, 1, 38, 152518, tzinfo=tzutc()), ‘_stop’: datetime.datetime(2021, 9, 13, 17, 1, 38, 152518, tzinfo=tzutc()), ‘_time’: datetime.datetime(2021, 9, 13, 5, 42, 50, 790000, tzinfo=tzutc()), ‘_value’: 225500, ‘_field’: ‘ask1_vol’, ‘_measurement’: ‘510050’, ‘mkt’: ‘SH’, ‘status’: ‘T’, ‘type’: ‘S’}
InfluxDB main: 2021-09-14 01:21:25.959709
cost 5.21 seconds setup streams and 216.81 seconds to download 2510664 results