Skip to content

Commit 230aa91

Browse files
appletreeisyellowjstirnaman
authored andcommitted
chore(dedicated): add filters on system table examples
1 parent 813a79c commit 230aa91

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

content/influxdb/cloud-dedicated/admin/custom-partitions/view-partitions.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -108,40 +108,26 @@ with the name of the table you want to query information about.
108108

109109
---
110110

111-
{{% code-placeholders "TABLE_NAME" %}}
111+
{{% code-placeholders "TABLE_NAME_(1|2|3)|TABLE_NAME" %}}
112112

113-
### View partition templates of all tables
113+
### View the partition template of a specific table
114114

115115
```sql
116-
SELECT * FROM system.tables
116+
SELECT * FROM system.tables WHERE table_name = 'TABLE_NAME'
117117
```
118118

119119
#### Example results
120120

121121
| table_name | partition_template |
122122
| :--------- | :----------------------------------------------------------------------------------------- |
123123
| weather | `{"parts":[{"timeFormat":"%Y-%m-%d"},{"bucket":{"tagName":"location","numBuckets":250}}]}` |
124-
| home | `{"parts":[{"timeFormat":"%Y-%m-%d"},{"tagValue":"room"},{"tagValue":"sensor_id"}]}` |
125-
| numbers | `{"parts":[{"timeFormat":"%Y"}]}` |
126124

127125
{{% note %}}
128126
If a table doesn't include a partition template in the output of this command,
129127
the table uses the default (1 day) partition strategy and doesn't partition
130128
by tags or tag buckets.
131129
{{% /note %}}
132130

133-
### View the partition template of a specific table
134-
135-
```sql
136-
SELECT * FROM system.tables WHERE table_name = 'TABLE_NAME'
137-
```
138-
139-
#### Example results
140-
141-
| table_name | partition_template |
142-
| :--------- | :----------------------------------------------------------------------------------------- |
143-
| weather | `{"parts":[{"timeFormat":"%Y-%m-%d"},{"bucket":{"tagName":"location","numBuckets":250}}]}` |
144-
145131
### View all partitions for a table
146132

147133
```sql
@@ -166,6 +152,8 @@ SELECT
166152
COUNT(*) AS partition_count
167153
FROM
168154
system.partitions
155+
WHERE
156+
table_name IN ('TABLE_NAME_1', 'TABLE_NAME_2', 'TABLE_NAME_3')
169157
GROUP BY
170158
table_name
171159
```

content/influxdb/cloud-dedicated/reference/cli/influxctl/query.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ Querying system tables can impact the overall performance of your
420420
InfluxDB's stable API and are subject to change.
421421
{{% /warn %}}
422422

423-
{{% code-placeholders "DATABASE_(TOKEN|NAME)" %}}
423+
{{% code-placeholders "DATABASE_(TOKEN|NAME)|TABLE_NAME" %}}
424424

425425
{{< code-tabs-wrapper >}}
426426
{{% code-tabs %}}
@@ -435,7 +435,7 @@ influxctl query \
435435
--enable-system-tables \
436436
--token DATABASE_TOKEN \
437437
--database DATABASE_NAME \
438-
"SELECT * FROM system.tables"
438+
"SELECT * FROM system.tables WHERE table_name = 'TABLE_NAME'"
439439
```
440440
{{% /influxdb/custom-timestamps %}}
441441
{{% /code-tab-content %}}

0 commit comments

Comments
 (0)