chore(clustered): add filters on system table examples

pull/5611/head
Chunchun 2024-09-24 13:47:56 -05:00
parent fc1fed1aa9
commit a9da4b7e90
No known key found for this signature in database
GPG Key ID: 55E75674884E73A1
2 changed files with 11 additions and 23 deletions

View File

@ -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
```

View File

@ -418,7 +418,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 %}}
@ -433,7 +433,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 %}}