influxdata / influxdata/influxdb

different user cost different time by the same sql

Open
#23,134 0 comments 0 reactions 0 assignees View on GitHub

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.

  1. use boss_metrics_read user, 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

  1. use boss_metrics user, 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.