influxdata / influxdata/influxdb
different user cost different time by the same sql
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
I use InfluxDB 1.8.3, find a very strange bug.
in the same machine, i use SHOW TAG KEYS FROM measurement to query the tag keys.
but there is a huge gap when i use different user to query it.
- use
boss_metrics_readuser, the user only have read privilege.
curl -s -w "time_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n" -GET 'http://localhost:8086/query?pretty=true&u=boss_metrics_read&p=xxxxxx' --data-urlencode "db=service_metrics" --data-urlencode "epoch=ms" --data-urlencode 'q=SHOW TAG KEYS FROM "service_server_rpc_v2_metrics"'
{
"results": [
{
"statement_id": 0,
"series": [
{
"name": "service_server_rpc_v2_metrics",
"columns": [
"tagKey"
],
"values": [
[
"class_method_name"
],
[
"class_name"
],
[
"client_instance"
],
[
"client_service"
],
[
"pkg_name"
],
[
"server_instance"
],
[
"server_service"
],
[
"traffic_type"
]
]
}
]
}
]
}
time_connect: 0.004
time_starttransfer: 12.113
time_total: 12.114
- use
boss_metricsuser, the user have the admin privilege. which is the daily use user when i write the data.
curl -s -w "time_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n" -GET 'http://localhost:8086/query?pretty=true&u=boss_metrics&p=xxxxx' --data-urlencode "db=service_metrics" --data-urlencode "epoch=ms" --data-urlencode 'q=SHOW TAG KEYS FROM "service_server_rpc_v2_metrics"'
{
"results": [
{
"statement_id": 0,
"series": [
{
"name": "service_server_rpc_v2_metrics",
"columns": [
"tagKey"
],
"values": [
[
"class_method_name"
],
[
"class_name"
],
[
"client_instance"
],
[
"client_service"
],
[
"pkg_name"
],
[
"server_instance"
],
[
"server_service"
],
[
"traffic_type"
]
]
}
]
}
]
}
time_connect: 0.004
time_starttransfer: 0.009
time_total: 0.009
Is that the tag keys is not cached in the memory? Why the query time is so incredible,hope to reply soon!
Thank You!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The report targets the /query endpoint and SHOW TAG KEYS in InfluxDB 1.8.3; start by tracing how this query is handled for read-only versus admin users and reproduce both curl requests. Done means the cause of the timing difference is identified and the behavior is corrected or documented with a regression check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100