Influxdb - iteration through influxdb.resultset.ResultSet with tag field slow

18 Views Asked by At

i'm wondering about the slowniness getting the data from a resultset with a group by tag field in python (v1.8). So unfortunately I can't use the new possibilities in v2.x .

time_predicates = get_time_predicates(from_date, to_date) 
query = ( 
    select count({count_column}) as count 
    f"from {measurement}" 
    f"where {' and '.join(time_predicates)} "
    f"group by country" 
)

Now when I iterate through this resultset it's unexpected slow. I tested different things in terms of list comprehension etc., but always it is surprising slow.

data = [] 
for measurement, tags in resultset.keys():     
    for points in resultset.get_points(measurement, tags):         
    data.append([tags['country'], points['count']])

Without the group by I can do just what is like a fast fetch_all, but without the tag field information:

get_points(measurement) 

Thanks in advance, Christian

0

There are 0 best solutions below