influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

Show tag values poor performance

Open saboteurkid opened this issue 10 years ago • 2 comments

System info: [InfluxDB 0.13.0, CentOS release 6.8 (Final)] Total rows: 680k~700k Number of tag value for "my_key": 27 curltime "http://127.0.0.1:8986/query?q=SHOW+TAG+VALUES+FROM+%22my_measurement%22+WITH+KEY+%3D+%22my_key%22&db=my_udp_db" Expected behavior: < 1000ms Actual behavior: 29,677(ms)

curltime "http://10.30.22.248:8986/query?q=select+count(a_field)+from+22my_measurement&db=my_udp_db"

Expected behavior: < 1000ms Actual behavior: 35,498(ms)

Current, I have 4 tag key. two of them is username and user id (these tag may be have more than 100k difference values and even more), and the rest may have <= 1000 values.

I'm tested on other measurements, even if the number of row in other measurement is quite big (>30 million) but the show tag values on those measurements still very fast. (number of tag values ~40)

Is the any problem with my db (in design)?

// My curltime function: function __curl_time(){ curl -o /dev/null -s -w %{time_total}\(ms\)\\n "$1" }

saboteurkid avatar Jul 15 '16 06:07 saboteurkid

Update: Currently, I've delete all of these measurements. Moving username and uid to field instead of key. But I think there still an issue, esspecially when I query on these measurement like: select * from my_measurement limit 1 drop measurement my_measurement - (this query take very long in admin dashboard, and sometime likely to shutdown influxdb) It crash my influxdb instance (I'm running in single mode).

saboteurkid avatar Jul 15 '16 07:07 saboteurkid

This was fixed by #6792 and is in the current 1.0beta releases.

jwilder avatar Jul 15 '16 15:07 jwilder