7
7
name : Report query performance issues
8
8
parent : Troubleshoot and optimize queries
9
9
weight : 402
10
+ related :
11
+ - /influxdb/clustered/admin/query-system-data/
10
12
---
11
13
12
14
These guidelines are intended to faciliate collaboration between InfluxData
@@ -23,13 +25,17 @@ queries](/influxdb/clustered/query-data//troubleshoot-and-optimize).
23
25
6 . [ Reduce query noise] ( #reduce-query-noise )
24
26
7 . [ Establish baseline single-query performance] ( #establish-baseline-single-query-performance )
25
27
8 . [ Run queries at multiple load scales] ( #run-queries-at-multiple-load-scales )
26
- 9 . [ Gather debug info ] ( #gather-debug-info )
28
+ 9 . [ Gather debug information ] ( #gather-debug-information )
27
29
1 . [ Kubernetes-specific information] ( #kubernetes-specific-information )
28
30
2 . [ Clustered-specific information] ( #clustered-specific-information )
29
31
3 . [ Query analysis] ( #query-analysis )
30
32
1 . [ EXPLAIN] ( #explain )
31
33
2 . [ EXPLAIN VERBOSE] ( #explain-verbose )
32
34
3 . [ EXPLAIN ANALYZE] ( #explain-analyze )
35
+ 10 . [ Gather system information] ( #gather-system-information )
36
+ - [ Collect table information] ( #collect-table-information )
37
+ - [ Collect compaction information for the table] ( #collect-compaction-information-for-the-table )
38
+ - [ Collect partition information for multiple tables] ( #collect-partition-information-for-multiple-tables )
33
39
34
40
{{% note %}}
35
41
Please note that this document may change from one support engagement to the
@@ -141,14 +147,21 @@ As an example, consider the following test plan outline:
141
147
4 . Run 10 concurrent instances of Query A and allow the cluster to recover for 1 minute.
142
148
5 . Run 20 concurrent instances of Query A and allow the cluster to recover for 1 minute.
143
149
6 . Run 40 concurrent instances of Query A and allow the cluster to recover for 1 minute.
144
- 7 . Provide InfluxData the debug information [ described below] ( #gather-debug-info ) .
150
+ 7 . Provide InfluxData the debug information [ described below] ( #gather-debug-information ) .
145
151
146
152
{{% note %}}
147
153
This is just an example. You don't have to go beyond the scale where queries get slower
148
154
but you may also need to go further than what's outlined here.
149
155
{{% /note %}}
150
156
151
- ### Gather debug info
157
+ ### Capture dashboard screens
158
+
159
+ If you have set up alerts and dashboards for monitoring your cluster, capture
160
+ screenshots of dashboard events for Queriers, Compactors, and Ingesters.
161
+
162
+ See [ system query examples] ( /influxdb/clustered/admin/query-system-data/#system-query-examples ) .
163
+
164
+ ### Gather debug information
152
165
153
166
The following debug information should be collected shortly _ after_ a
154
167
problematic query has been tried against your InfluxDB cluster.
@@ -165,7 +178,7 @@ kubectl cluster-info dump --namespace influxdb --output-directory "${DATETIME}-c
165
178
tar -czf "${DATETIME}-cluster-info.tar.gz" "${DATETIME}-cluster-info/"
166
179
```
167
180
168
- #### Clustered-Specific Info
181
+ #### Clustered-specific information
169
182
170
183
** Outputs:**
171
184
@@ -310,3 +323,71 @@ curl --get "https://{{< influxdb/host >}}/query" \
310
323
{{< /code-tabs-wrapper >}}
311
324
312
325
{{% /code-placeholders %}}
326
+
327
+ ### Gather system information
328
+
329
+ {{% warn %}}
330
+ #### May impact cluster performance
331
+
332
+ Querying InfluxDB v3 system tables may impact write and query
333
+ performance of your {{< product-name omit=" Clustered" >}} cluster.
334
+ Use filters to [ optimize queries to reduce impact to your cluster] ( /influxdb/clustered/admin/query-system-data/#optimize-queries-to-reduce-impact-to-your-cluster ) .
335
+
336
+ <!-- ------------- UPDATE THE DATE BELOW AS EXAMPLES ARE UPDATED --------------->
337
+
338
+ #### System tables are subject to change
339
+
340
+ System tables are not part of InfluxDB's stable API and may change with new releases.
341
+ The provided schema information and query examples are valid as of ** September 20, 2024** .
342
+ If you detect a schema change or a non-functioning query example, please
343
+ [ submit an issue] ( https://github.com/influxdata/docs-v2/issues/new/choose ) .
344
+
345
+ <!-- ------------- UPDATE THE DATE ABOVE AS EXAMPLES ARE UPDATED --------------->
346
+ {{% /warn %}}
347
+
348
+ If queries are slow for a specific table, run the following system queries to collect information for troubleshooting.
349
+
350
+ - [ Collect table information] ( #collect-table-information )
351
+ - [ Collect compaction information for the table] ( #collect-compaction-information-for-the-table )
352
+ - [ Collect partition information for multiple tables] ( #collect-partition-information-for-multiple-tables )
353
+
354
+ In your queries, replace the following:
355
+
356
+ - {{% code-placeholder-key %}}` TABLE_NAME ` {{% /code-placeholder-key %}}: the
357
+ table to retrieve information about
358
+
359
+ #### Collect table information
360
+
361
+ {{% code-placeholders "TABLE_NAME" %}}
362
+ ``` sql
363
+ SELECT *
364
+ FROM system .tables
365
+ WHERE table_name = ' TABLE_NAME' ;
366
+ ```
367
+ {{% /code-placeholders%}}
368
+
369
+ #### Collect compaction information for the table
370
+
371
+ {{% code-placeholders "TABLE_NAME" %}}
372
+ ``` sql
373
+ SELECT *
374
+ FROM system .compactor
375
+ WHERE table_name = ' TABLE_NAME' ;
376
+ ```
377
+ {{% /code-placeholders%}}
378
+
379
+ #### Collect partition information for multiple tables
380
+
381
+ If the same queries are slow on more than 1 table, also run the following query to collect the size and
382
+ number of partitions for all tables:
383
+
384
+ {{% code-placeholders "TABLE_NAME" %}}
385
+ ``` sql
386
+ SELECT table_name,
387
+ COUNT (* ) as partition_count,
388
+ MAX (last_new_file_created_at) as last_new_file_created_at,
389
+ SUM (total_size_mb) as total_size_mb
390
+ FROM system .partitions
391
+ GROUP BY table_name;
392
+ ```
393
+ {{% /code-placeholders%}}
0 commit comments