From 2ace7c5f7dfd557b7ec4e089cee7c50dd46d1a2b Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 17 May 2024 08:26:47 -0600 Subject: [PATCH] document show retention policies InfluxQL statement (#5474) --- .../reference/influxql/_index.md | 1 + .../reference/influxql/feature-support.md | 1 + .../reference/influxql/show.md | 35 +++++++++++++++++- .../reference/influxql/_index.md | 1 + .../reference/influxql/feature-support.md | 1 + .../reference/influxql/show.md | 37 ++++++++++++++++++- .../clustered/reference/influxql/_index.md | 1 + .../reference/influxql/feature-support.md | 1 + .../clustered/reference/influxql/show.md | 35 +++++++++++++++++- 9 files changed, 109 insertions(+), 4 deletions(-) diff --git a/content/influxdb/cloud-dedicated/reference/influxql/_index.md b/content/influxdb/cloud-dedicated/reference/influxql/_index.md index db2e55397..2389c551a 100644 --- a/content/influxdb/cloud-dedicated/reference/influxql/_index.md +++ b/content/influxdb/cloud-dedicated/reference/influxql/_index.md @@ -272,6 +272,7 @@ statement = explain_stmt | select_stmt | show_field_keys_stmt | show_measurements_stmt | + show_retention_policies_stmt | show_tag_keys_stmt | show_tag_values_with_key = stmt . ``` diff --git a/content/influxdb/cloud-dedicated/reference/influxql/feature-support.md b/content/influxdb/cloud-dedicated/reference/influxql/feature-support.md index 0de04eaa5..72a67d3fe 100644 --- a/content/influxdb/cloud-dedicated/reference/influxql/feature-support.md +++ b/content/influxdb/cloud-dedicated/reference/influxql/feature-support.md @@ -62,6 +62,7 @@ The following table provides information about what metaqueries are available in | Metaquery | Supported | | :------------------------------------------------------------ | :----------------------: | | SHOW DATABASES | | +| **SHOW RETENTION POLICIES** | **{{< icon "check" >}}** | | **SHOW MEASUREMENTS** | **{{< icon "check" >}}** | | SHOW SERIES | | | SHOW SERIES CARDINALITY | | diff --git a/content/influxdb/cloud-dedicated/reference/influxql/show.md b/content/influxdb/cloud-dedicated/reference/influxql/show.md index 576c58bf0..a33950ceb 100644 --- a/content/influxdb/cloud-dedicated/reference/influxql/show.md +++ b/content/influxdb/cloud-dedicated/reference/influxql/show.md @@ -10,7 +10,7 @@ menu: weight: 207 list_code_example: | ```sql - SHOW [MEASUREMENTS | FIELD KEYS | TAG KEYS | TAG VALUES] + SHOW [RETENTION POLICIES | MEASUREMENTS | FIELD KEYS | TAG KEYS | TAG VALUES] ``` related: - /influxdb/cloud-dedicated/query-data/influxql/explore-schema/ @@ -18,11 +18,44 @@ related: Use InfluxQL `SHOW` statements to query schema information from a database. +- [SHOW RETENTION POLICIES](#show-retention-policies) - [SHOW MEASUREMENTS](#show-measurements) - [SHOW FIELD KEYS](#show-field-keys) - [SHOW TAG KEYS](#show-tag-keys) - [SHOW TAG VALUES](#show-tag-values) +## SHOW RETENTION POLICIES + +Use the `SHOW RETENTION POLICIES` statement to list retention policies associated +with a database. +Each database has a single retention policy--`autogen`. + +{{% note %}} +In {{< product-name >}}, retention policies are not part of the +data structure but are expected by InfluxQL and used in fully-qualified measurements +in the [`FROM` clause](/influxdb/cloud-dedicated/reference/influxql/select/#from-clause). +The data returned for each retention policy does not represent the actual +retention-related attributes of the database. The values are placeholder values +meant only for InfluxQL feature parity. + +For information about database data retention, see +[List databases](/influxdb/cloud-dedicated/admin/databases/list/). +{{% /note %}} + +```sql +SHOW RETENTION POLICIES [ON ] +``` + +#### Examples + +```sql +-- Show retention policies in the database specified in the query request +SHOW RETENTION POLICIES + +-- Show retention policies in a specific database +SHOW RETENTION POLICIES ON "example-database" +``` + ## SHOW MEASUREMENTS Use the `SHOW MEASUREMENTS` statement to list measurements in a database. diff --git a/content/influxdb/cloud-serverless/reference/influxql/_index.md b/content/influxdb/cloud-serverless/reference/influxql/_index.md index a49de51af..75ecdad2a 100644 --- a/content/influxdb/cloud-serverless/reference/influxql/_index.md +++ b/content/influxdb/cloud-serverless/reference/influxql/_index.md @@ -272,6 +272,7 @@ statement = explain_stmt | select_stmt | show_field_keys_stmt | show_measurements_stmt | + show_retention_policies_stmt | show_tag_keys_stmt | show_tag_values_with_key = stmt . ``` diff --git a/content/influxdb/cloud-serverless/reference/influxql/feature-support.md b/content/influxdb/cloud-serverless/reference/influxql/feature-support.md index aaf0775c9..16257c1ac 100644 --- a/content/influxdb/cloud-serverless/reference/influxql/feature-support.md +++ b/content/influxdb/cloud-serverless/reference/influxql/feature-support.md @@ -62,6 +62,7 @@ The following table provides information about what metaqueries are available in | Metaquery | Supported | | :------------------------------------------------------------ | :----------------------: | | SHOW DATABASES | | +| **SHOW RETENTION POLICIES** | **{{< icon "check" >}}** | | **SHOW MEASUREMENTS** | **{{< icon "check" >}}** | | SHOW SERIES | | | SHOW SERIES CARDINALITY | | diff --git a/content/influxdb/cloud-serverless/reference/influxql/show.md b/content/influxdb/cloud-serverless/reference/influxql/show.md index 7a50d642f..3b1901618 100644 --- a/content/influxdb/cloud-serverless/reference/influxql/show.md +++ b/content/influxdb/cloud-serverless/reference/influxql/show.md @@ -10,19 +10,52 @@ menu: weight: 207 list_code_example: | ```sql - SHOW [MEASUREMENTS | FIELD KEYS | TAG KEYS | TAG VALUES] + SHOW [RETENTION POLICIES | MEASUREMENTS | FIELD KEYS | TAG KEYS | TAG VALUES] ``` related: - /influxdb/cloud-serverless/query-data/influxql/explore-schema/ --- -Use InfluxQL `SHOW` statements to query schema information from a bucket. +Use InfluxQL `SHOW` statements to query schema information from a database. +- [SHOW RETENTION POLICIES](#show-retention-policies) - [SHOW MEASUREMENTS](#show-measurements) - [SHOW FIELD KEYS](#show-field-keys) - [SHOW TAG KEYS](#show-tag-keys) - [SHOW TAG VALUES](#show-tag-values) +## SHOW RETENTION POLICIES + +Use the `SHOW RETENTION POLICIES` statement to list retention policies associated +with a database. +Each database has a single retention policy--`autogen`. + +{{% note %}} +In {{< product-name >}}, retention policies are not part of the +data structure but are expected by InfluxQL and used in fully-qualified measurements +in the [`FROM` clause](/influxdb/cloud-serverless/reference/influxql/select/#from-clause). +The data returned for each retention policy does not represent the actual +retention-related attributes of the database. The values are placeholder values +meant only for InfluxQL feature parity. + +For information about database data retention, see +[List databases](/influxdb/cloud-serverless/admin/databases/list/). +{{% /note %}} + +```sql +SHOW RETENTION POLICIES [ON ] +``` + +#### Examples + +```sql +-- Show retention policies in the database specified in the query request +SHOW RETENTION POLICIES + +-- Show retention policies in a specific database +SHOW RETENTION POLICIES ON "example-database" +``` + ## SHOW MEASUREMENTS Use the `SHOW MEASUREMENTS` statement to list measurements in a bucket. diff --git a/content/influxdb/clustered/reference/influxql/_index.md b/content/influxdb/clustered/reference/influxql/_index.md index b06c14e51..25f21e329 100644 --- a/content/influxdb/clustered/reference/influxql/_index.md +++ b/content/influxdb/clustered/reference/influxql/_index.md @@ -272,6 +272,7 @@ statement = explain_stmt | select_stmt | show_field_keys_stmt | show_measurements_stmt | + show_retention_policies_stmt | show_tag_keys_stmt | show_tag_values_with_key = stmt . ``` diff --git a/content/influxdb/clustered/reference/influxql/feature-support.md b/content/influxdb/clustered/reference/influxql/feature-support.md index b0358de96..ce3bb42f6 100644 --- a/content/influxdb/clustered/reference/influxql/feature-support.md +++ b/content/influxdb/clustered/reference/influxql/feature-support.md @@ -62,6 +62,7 @@ The following table provides information about what metaqueries are available in | Metaquery | Supported | | :------------------------------------------------------------ | :----------------------: | | SHOW DATABASES | | +| **SHOW RETENTION POLICIES** | **{{< icon "check" >}}** | | **SHOW MEASUREMENTS** | **{{< icon "check" >}}** | | SHOW SERIES | | | SHOW SERIES CARDINALITY | | diff --git a/content/influxdb/clustered/reference/influxql/show.md b/content/influxdb/clustered/reference/influxql/show.md index 4ddcb3ba1..4abb65865 100644 --- a/content/influxdb/clustered/reference/influxql/show.md +++ b/content/influxdb/clustered/reference/influxql/show.md @@ -10,7 +10,7 @@ menu: weight: 207 list_code_example: | ```sql - SHOW [MEASUREMENTS | FIELD KEYS | TAG KEYS | TAG VALUES] + SHOW [RETENTION POLICIES | MEASUREMENTS | FIELD KEYS | TAG KEYS | TAG VALUES] ``` related: - /influxdb/clustered/query-data/influxql/explore-schema/ @@ -18,11 +18,44 @@ related: Use InfluxQL `SHOW` statements to query schema information from a database. +- [SHOW RETENTION POLICIES](#show-retention-policies) - [SHOW MEASUREMENTS](#show-measurements) - [SHOW FIELD KEYS](#show-field-keys) - [SHOW TAG KEYS](#show-tag-keys) - [SHOW TAG VALUES](#show-tag-values) +## SHOW RETENTION POLICIES + +Use the `SHOW RETENTION POLICIES` statement to list retention policies associated +with a database. +Each database has a single retention policy--`autogen`. + +{{% note %}} +In {{< product-name >}}, retention policies are not part of the +data structure but are expected by InfluxQL and used in fully-qualified measurements +in the [`FROM` clause](/influxdb/clustered/reference/influxql/select/#from-clause). +The data returned for each retention policy does not represent the actual +retention-related attributes of the database. The values are placeholder values +meant only for InfluxQL feature parity. + +For information about database data retention, see +[List databases](/influxdb/clustered/admin/databases/list/). +{{% /note %}} + +```sql +SHOW RETENTION POLICIES [ON ] +``` + +#### Examples + +```sql +-- Show retention policies in the database specified in the query request +SHOW RETENTION POLICIES + +-- Show retention policies in a specific database +SHOW RETENTION POLICIES ON "example-database" +``` + ## SHOW MEASUREMENTS Use the `SHOW MEASUREMENTS` statement to list measurements in a database.