import boto3
device_list = ['ARMS-GFY-D5', 'ARMS-GFY-D3']
client = boto3.client('timestream-query')
for device_id in device_list:
query = f"""
SELECT time, charge, current, voltage, temperature
FROM "telemetryDatabase"."telemetryTable"
WHERE device_id = '{device_id}'
AND time > ago(24h)
ORDER BY time
"""
response = client.query(QueryString=query)
In all cases the output is small, only about 12kB (288 rows). Reducing the time range of the query has no impact on query time.
My laptop has a gigabit internet connection and no obvious network throughput issues to AWS.
The table schema:
Why is boto3 so much slower than AWS console, seemingly only until the client is "warm"? How can I avoid this behavior?