Skip to content

Commit 403cbfe

Browse files
appletreeisyellowjstirnaman
authored andcommitted
chore(clustered): add filters on system table examples
1 parent 230aa91 commit 403cbfe

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

content/influxdb/clustered/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/clustered/reference/cli/influxctl/query.md

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

421-
{{% code-placeholders "DATABASE_(TOKEN|NAME)" %}}
421+
{{% code-placeholders "DATABASE_(TOKEN|NAME)|TABLE_NAME" %}}
422422

423423
{{< code-tabs-wrapper >}}
424424
{{% code-tabs %}}
@@ -433,7 +433,7 @@ influxctl query \
433433
--enable-system-tables \
434434
--token DATABASE_TOKEN \
435435
--database DATABASE_NAME \
436-
"SELECT * FROM system.tables"
436+
"SELECT * FROM system.tables WHERE table_name = 'TABLE_NAME'"
437437
```
438438
{{% /influxdb/custom-timestamps %}}
439439
{{% /code-tab-content %}}

0 commit comments

Comments
 (0)