You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{< product-name >}} stores data related to queries, tables, partitions, and
16
17
compaction in _system tables_ within your cluster.
18
+
System tables contain time series data used by and generated from the
19
+
{{< product-name >}} internal monitoring system.
17
20
You can query the cluster system tables for information about your cluster.
18
21
19
22
-[Query system tables](#query-system-tables)
20
23
-[Optimize queries to reduce impact to your cluster](#optimize-queries-to-reduce-impact-to-your-cluster)
21
24
-[System tables](#system-tables)
25
+
-[Understanding system table data distribution](#understanding-system-table-data-distribution)
22
26
-[system.queries](#systemqueries)
23
27
-[system.tables](#systemtables)
24
28
-[system.partitions](#systempartitions)
@@ -50,7 +54,6 @@ If you detect a schema change or a non-functioning query example, please
50
54
51
55
## Query system tables
52
56
53
-
54
57
{{% note %}}
55
58
Querying system tables with `influxctl` requires **`influxctl` v2.8.0 or newer**.
56
59
{{% /note %}}
@@ -259,19 +262,40 @@ Use the `AND`, `OR`, or `IN` keywords to combine filters in your query.
259
262
_System tables are [subject to change](#system-tables-are-subject-to-change)._
260
263
{{% /warn %}}
261
264
265
+
### Understanding system table data distribution
266
+
267
+
Data in `system.tables`, `system.partitions`, and `system.compactor` includes
268
+
data for all [InfluxDB Queriers](/influxdb/cloud-dedicated/reference/internals/storage-engine/#querier) in your cluster.
269
+
The data comes from the catalog, and because all the queriers share one catalog,
270
+
the results from these three tables derive from the same source data,
271
+
regardless of which querier you connect to.
272
+
273
+
However, the `system.queries` table is different--data is local to each Querier.
274
+
`system.queries` contains a non-persisted log of queries run against the current
275
+
querier to which your query is routed.
276
+
The query log is specific to the current Querier and isn't shared across
277
+
queriers in your cluster.
278
+
Logs are scoped to the specified database.
279
+
262
280
-[system.queries](#systemqueries)
263
281
-[system.tables](#systemtables)
264
282
-[system.partitions](#systempartitions)
265
283
-[system.compactor](#systemcompactor)
266
284
267
285
### system.queries
268
286
269
-
The `system.queries` table contains an unpersisted log of queries run against
270
-
the current [InfluxDB Querier](/influxdb/cloud-dedicated/reference/internals/storage-engine/#querier)
271
-
to which your query is routed.
272
-
The query log is specific to the current Querier and is not shared across Queriers
273
-
in your cluster.
274
-
Logs are scoped to the specified database.
287
+
The `system.queries` table stores log entries for queries executed for the provided namespace (database) on the node that is _currently handling queries_.
288
+
`system.queries` reflects a process-local, in-memory, namespace-scoped query log.
289
+
290
+
While this table may be useful for debugging and monitoring queries, keep the following in mind:
291
+
292
+
- Records stored in `system.queries` are transient and volatile
293
+
- InfluxDB deletes `system.queries` records during pod restarts.
294
+
- Queries for one namespace can evict records from another namespace.
295
+
- Data reflects the state of a specific pod answering queries for the namespace.
296
+
- Data isn't shared across queriers in your cluster.
297
+
- A query for records in `system.queries` can return different results
298
+
depending on the pod the request was routed to.
275
299
276
300
{{< expand-wrapper >}}
277
301
{{% expand "View `system.queries` schema" %}}
@@ -280,9 +304,9 @@ The `system.queries` table contains the following columns:
280
304
281
305
- id
282
306
- phase
283
-
- issue_time
284
-
- query_type
285
-
- query_text
307
+
-**issue_time**: timestamp when the query was issued
308
+
-**query_type**: type (syntax: `sql`, `flightsql`, or `influxql`) of the query
309
+
-**query_text**: query statement text
286
310
- partitions
287
311
- parquet_files
288
312
- plan_duration
@@ -291,14 +315,20 @@ The `system.queries` table contains the following columns:
291
315
- end2end_duration
292
316
- compute_duration
293
317
- max_memory
294
-
- success
318
+
-**success**: execution status (boolean) of the query
295
319
- running
296
320
- cancelled
297
-
- trace_id
321
+
-**trace_id**: trace ID for debugging and monitoring events
298
322
299
323
{{% /expand %}}
300
324
{{< /expand-wrapper >}}
301
325
326
+
{{% note %}}
327
+
_When listing measurements (tables) available within a namespace,
328
+
some clients and query tools may include the `queries` table in the list of
329
+
namespace tables._
330
+
{{% /note %}}
331
+
302
332
### system.tables
303
333
304
334
The `system.tables` table contains information about tables in the specified database.
@@ -372,6 +402,7 @@ The examples in this section include `WHERE` filters to [optimize queries and re
372
402
-[Query logs](#query-logs)
373
403
-[View all stored query logs](#view-all-stored-query-logs)
374
404
-[View query logs for queries with end-to-end durations above a threshold](#view-query-logs-for-queries-with-end-to-end-durations-above-a-threshold)
405
+
-[View query logs for a specific query within a time interval](#view-query-logs-for-a-specific-query-within-a-time-interval)
375
406
-[Partitions](#partitions)
376
407
-[View the partition template of a specific table](#view-the-partition-template-of-a-specific-table)
377
408
-[View all partitions for a table](#view-all-partitions-for-a-table)
@@ -414,6 +445,46 @@ WHERE
414
445
end2end_duration::BIGINT> (50*1000000)
415
446
```
416
447
448
+
### View query logs for a specific query within a time interval
0 commit comments