Closed
Description
Hello,
I just did tests with InfluxQL in cURL in terminal, and it works very fast (milliseconds), now the same query takes up to 19 seconds in influxdb-rust.
Any idea what the problem may be?
- Rust Version: rustc 1.50.0 (cb75ad5db 2021-02-10)
- Runtime version (e.g. Tokio): 0.2.22
- OS Version: MacOS 10.14.6
Steps to Reproduce:
#[tokio::main]
async fn main() {
// Connect to db `test` on `http://localhost:8086`
let client = Client::new("https://influxdb-host", "example_db")
.with_token("jwt");
// Let's see if the data we wrote is there
let read_query = Query::raw_read_query("SELECT * FROM example_db.example_rp.history WHERE tag='example'");
let start = Time::now();
let result = client
.query(&read_query)
.await;
let end = Time::now();
println!("{}", result.unwrap());
println!("{:?}", end - start); // Duration { seconds: 16, nanoseconds: 823561000 }
}
VS
curl --get https://influxdb-host/query?db=example_db \
--header "Authorization: Token jwt" \
--data-urlencode "q=SELECT * FROM example_db.example_rp.history WHERE tag='example'"
# took miliseconds
Metadata
Metadata
Assignees
Labels
No labels