Skip to content

Commit 43bcf7c

Browse files
committed
fix(v3): Format placeholders.
1 parent 965035a commit 43bcf7c

File tree

2 files changed

+44
-22
lines changed

2 files changed

+44
-22
lines changed

content/influxdb/cloud-dedicated/admin/query-system-data.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,61 +140,70 @@ seconds or longer as files and partitions increase.
140140
Use the following filters to optimize your system table queries and reduce the impact on your
141141
cluster's performance.
142142

143+
In your queries, replace the following:
144+
145+
- {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}: the table to retrieve partitions for
146+
- {{% code-placeholder-key %}}`PARTITION_ID`{{% /code-placeholder-key %}}: a [partition ID](#retrieve-a-partition-id) (int64)
147+
- {{% code-placeholder-key %}}`PARTITION_KEY`{{% /code-placeholder-key %}}: a [partition key](/influxdb/cloud-dedicated/admin/custom-partitions/#partition-keys)
148+
derived from the table's partition template.
149+
The default format is `%Y-%m-%d` (for example, `2024-01-01`).
150+
143151
##### Filter by table name
144152

145153
When querying the `system.tables`, `system.partitions`, or `system.compactor` tables, use the
146154
`WHERE` clause to filter by `table_name` .
147155

156+
{{% code-placeholders "TABLE_NAME" %}}
148157
```sql
149158
SELECT * FROM system.partitions WHERE table_name = 'TABLE_NAME'
150159
```
160+
{{% /code-placeholders%}}
151161

152162
##### Filter by partition key
153163

154164
When querying the `system.partitions` or `system.compactor` tables, use the `WHERE` clause to
155-
filter by `partition_key` .
165+
filter by `partition_key`.
156166

167+
{{% code-placeholders "PARTITION_KEY" %}}
157168
```sql
158169
SELECT * FROM system.partitions WHERE partition_key = 'PARTITION_KEY'
159170
```
171+
{{% /code-placeholders %}}
160172

161173
To further improve performance, use `AND` to pair `partition_key` with `table_name`--for example:
162-
174+
175+
{{% code-placeholders "TABLE_NAME|PARTITION_KEY" %}}
163176
```sql
164177
SELECT *
165178
FROM system.partitions
166179
WHERE
167180
table_name = 'TABLE_NAME'
168181
AND partition_key = 'PARTITION_KEY';
169182
```
170-
171-
Replace the following:
172-
173-
- `TABLE_NAME`: the table to retrieve partitions for
174-
- `PARTITION_KEY`: a [partition key](/influxdb/cloud-dedicated/admin/custom-partitions/#partition-keys)
175-
derived from the table's partition template.
176-
The default format is `%Y-%m-%d` (for example, `2024-01-01`).
183+
{{% /code-placeholders %}}
177184

178185
##### Filter by partition ID
179186

180187
When querying the `system.partitions` or `system.compactor` table, use the `WHERE` clause to
181188
filter by `partition_id` .
182189

190+
{{% code-placeholders "PARTITION_ID" %}}
183191
```sql
184192
SELECT * FROM system.partitions WHERE partition_id = PARTITION_ID
185193
```
194+
{{% /code-placeholders %}}
186195

187196
For the most optimized approach, use `AND` to pair `partition_id` with `table_name`--for example:
188197

198+
{{% code-placeholders "TABLE_NAME|PARTITION_ID" %}}
189199
```sql
190200
SELECT *
191201
FROM system.partitions
192202
WHERE
193203
table_name = 'TABLE_NAME'
194204
AND partition_id = PARTITION_ID;
195205
```
196-
197-
- `PARTITION_ID`: a [partition ID](#retrieve-a-partition-id) (int64)
206+
{{% /code-placeholders %}}
198207

199208
Although you don't need to pair `partition_id` with `table_name` (because a partition ID is unique within a cluster),
200209
it's the most optimized approach, _especially when you have many tables in a database_.
@@ -203,6 +212,7 @@ it's the most optimized approach, _especially when you have many tables in a dat
203212

204213
To retrieve a partition ID, query `system.partitions` for a `table_name` and `partition_key` pair--for example:
205214

215+
{{% code-placeholders "TABLE_NAME|PARTITION_KEY" %}}
206216
```sql
207217
SELECT
208218
table_name,
@@ -213,6 +223,7 @@ WHERE
213223
table_name = 'TABLE_NAME'
214224
AND partition_key = 'PARTITION_KEY';
215225
```
226+
{{% /code-placeholders %}}
216227

217228
The result contains the `partition_id`:
218229

content/influxdb/clustered/admin/query-system-data.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,61 +140,70 @@ seconds or longer as files and partitions increase.
140140
Use the following filters to optimize your system table queries and reduce the impact on your
141141
cluster's performance.
142142

143+
In your queries, replace the following:
144+
145+
- {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}: the table to retrieve partitions for
146+
- {{% code-placeholder-key %}}`PARTITION_ID`{{% /code-placeholder-key %}}: a [partition ID](#retrieve-a-partition-id) (int64)
147+
- {{% code-placeholder-key %}}`PARTITION_KEY`{{% /code-placeholder-key %}}: a [partition key](/influxdb/clustered/admin/custom-partitions/#partition-keys)
148+
derived from the table's partition template.
149+
The default format is `%Y-%m-%d` (for example, `2024-01-01`).
150+
143151
##### Filter by table name
144152

145153
When querying the `system.tables`, `system.partitions`, or `system.compactor` tables, use the
146154
`WHERE` clause to filter by `table_name` .
147155

156+
{{% code-placeholders "TABLE_NAME" %}}
148157
```sql
149158
SELECT * FROM system.partitions WHERE table_name = 'TABLE_NAME'
150159
```
160+
{{% /code-placeholders%}}
151161

152162
##### Filter by partition key
153163

154164
When querying the `system.partitions` or `system.compactor` tables, use the `WHERE` clause to
155-
filter by `partition_key` .
165+
filter by `partition_key`.
156166

167+
{{% code-placeholders "PARTITION_KEY" %}}
157168
```sql
158169
SELECT * FROM system.partitions WHERE partition_key = 'PARTITION_KEY'
159170
```
171+
{{% /code-placeholders %}}
160172

161173
To further improve performance, use `AND` to pair `partition_key` with `table_name`--for example:
162-
174+
175+
{{% code-placeholders "TABLE_NAME|PARTITION_KEY" %}}
163176
```sql
164177
SELECT *
165178
FROM system.partitions
166179
WHERE
167180
table_name = 'TABLE_NAME'
168181
AND partition_key = 'PARTITION_KEY';
169182
```
170-
171-
Replace the following:
172-
173-
- `TABLE_NAME`: the table to retrieve partitions for
174-
- `PARTITION_KEY`: a [partition key](/influxdb/clustered/admin/custom-partitions/#partition-keys)
175-
derived from the table's partition template.
176-
The default format is `%Y-%m-%d` (for example, `2024-01-01`).
183+
{{% /code-placeholders %}}
177184

178185
##### Filter by partition ID
179186

180187
When querying the `system.partitions` or `system.compactor` table, use the `WHERE` clause to
181188
filter by `partition_id` .
182189

190+
{{% code-placeholders "PARTITION_ID" %}}
183191
```sql
184192
SELECT * FROM system.partitions WHERE partition_id = PARTITION_ID
185193
```
194+
{{% /code-placeholders %}}
186195

187196
For the most optimized approach, use `AND` to pair `partition_id` with `table_name`--for example:
188197

198+
{{% code-placeholders "TABLE_NAME|PARTITION_ID" %}}
189199
```sql
190200
SELECT *
191201
FROM system.partitions
192202
WHERE
193203
table_name = 'TABLE_NAME'
194204
AND partition_id = PARTITION_ID;
195205
```
196-
197-
- `PARTITION_ID`: a [partition ID](#retrieve-a-partition-id) (int64)
206+
{{% /code-placeholders %}}
198207

199208
Although you don't need to pair `partition_id` with `table_name` (because a partition ID is unique within a cluster),
200209
it's the most optimized approach, _especially when you have many tables in a database_.
@@ -203,6 +212,7 @@ it's the most optimized approach, _especially when you have many tables in a dat
203212

204213
To retrieve a partition ID, query `system.partitions` for a `table_name` and `partition_key` pair--for example:
205214

215+
{{% code-placeholders "TABLE_NAME|PARTITION_KEY" %}}
206216
```sql
207217
SELECT
208218
table_name,
@@ -213,6 +223,7 @@ WHERE
213223
table_name = 'TABLE_NAME'
214224
AND partition_key = 'PARTITION_KEY';
215225
```
226+
{{% /code-placeholders %}}
216227

217228
The result contains the `partition_id`:
218229

0 commit comments

Comments
 (0)