From fc1fed1aa922e51bfc24ceceb73eeccc285e9eb9 Mon Sep 17 00:00:00 2001 From: Chunchun <14298407+appletreeisyellow@users.noreply.github.com> Date: Tue, 24 Sep 2024 13:47:13 -0500 Subject: [PATCH] chore(dedicated): add filters on system table examples --- .../custom-partitions/view-partitions.md | 30 ++++++------------- .../reference/cli/influxctl/query.md | 4 +-- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/content/influxdb/cloud-dedicated/admin/custom-partitions/view-partitions.md b/content/influxdb/cloud-dedicated/admin/custom-partitions/view-partitions.md index 38b667011..349c21a82 100644 --- a/content/influxdb/cloud-dedicated/admin/custom-partitions/view-partitions.md +++ b/content/influxdb/cloud-dedicated/admin/custom-partitions/view-partitions.md @@ -108,27 +108,7 @@ with the name of the table you want to query information about. --- -{{% code-placeholders "TABLE_NAME" %}} - -### View partition templates of all tables - -```sql -SELECT * FROM system.tables -``` - -#### Example results - -| table_name | partition_template | -| :--------- | :----------------------------------------------------------------------------------------- | -| weather | `{"parts":[{"timeFormat":"%Y-%m-%d"},{"bucket":{"tagName":"location","numBuckets":250}}]}` | -| home | `{"parts":[{"timeFormat":"%Y-%m-%d"},{"tagValue":"room"},{"tagValue":"sensor_id"}]}` | -| numbers | `{"parts":[{"timeFormat":"%Y"}]}` | - -{{% note %}} -If a table doesn't include a partition template in the output of this command, -the table uses the default (1 day) partition strategy and doesn't partition -by tags or tag buckets. -{{% /note %}} +{{% code-placeholders "TABLE_NAME_(1|2|3)|TABLE_NAME" %}} ### View the partition template of a specific table @@ -142,6 +122,12 @@ SELECT * FROM system.tables WHERE table_name = 'TABLE_NAME' | :--------- | :----------------------------------------------------------------------------------------- | | weather | `{"parts":[{"timeFormat":"%Y-%m-%d"},{"bucket":{"tagName":"location","numBuckets":250}}]}` | +{{% note %}} +If a table doesn't include a partition template in the output of this command, +the table uses the default (1 day) partition strategy and doesn't partition +by tags or tag buckets. +{{% /note %}} + ### View all partitions for a table ```sql @@ -166,6 +152,8 @@ SELECT COUNT(*) AS partition_count FROM system.partitions +WHERE + table_name IN ('TABLE_NAME_1', 'TABLE_NAME_2', 'TABLE_NAME_3') GROUP BY table_name ``` diff --git a/content/influxdb/cloud-dedicated/reference/cli/influxctl/query.md b/content/influxdb/cloud-dedicated/reference/cli/influxctl/query.md index 1a58f28bd..66151e621 100644 --- a/content/influxdb/cloud-dedicated/reference/cli/influxctl/query.md +++ b/content/influxdb/cloud-dedicated/reference/cli/influxctl/query.md @@ -420,7 +420,7 @@ Querying system tables can impact the overall performance of your InfluxDB's stable API and are subject to change. {{% /warn %}} -{{% code-placeholders "DATABASE_(TOKEN|NAME)" %}} +{{% code-placeholders "DATABASE_(TOKEN|NAME)|TABLE_NAME" %}} {{< code-tabs-wrapper >}} {{% code-tabs %}} @@ -435,7 +435,7 @@ influxctl query \ --enable-system-tables \ --token DATABASE_TOKEN \ --database DATABASE_NAME \ - "SELECT * FROM system.tables" + "SELECT * FROM system.tables WHERE table_name = 'TABLE_NAME'" ``` {{% /influxdb/custom-timestamps %}} {{% /code-tab-content %}}