Merge branch 'master' into chore-telegraf-install-and-config

pull/5577/head
Jason Stirnaman 2024-08-27 10:14:32 -05:00 committed by GitHub
commit 1feae4f9c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
34 changed files with 828 additions and 483 deletions

View File

@ -47,12 +47,9 @@ As you plan your partitioning strategy, keep in mind that data can be
having to retrieve and read many partitions from the object store, which
hurts query performance.
- Avoid using partition time intervals that are **less than one day**.
The partition time interval should be balanced with the actual amount of data
written during each interval. If a single interval doesn't contain a lot of data,
- Balance the partition time interval with the actual amount of data written
during each interval. If a single interval doesn't contain a lot of data,
it is better to partition by larger time intervals.
- Don't partition by tags that you typically don't use in your query workload.
- Don't partition by distinct values of high-cardinality tags.
Instead, [use tag buckets](#use-tag-buckets-for-high-cardinality-tags) to

View File

@ -28,13 +28,13 @@ table.
- [Create a table with a custom partition template](#create-a-table-with-a-custom-partition-template)
- [Example partition templates](#example-partition-templates)
{{% note %}}
{{% warn %}}
#### Partition templates can only be applied on create
You can only apply a partition template when creating a database or table.
You can't update a partition template on an existing resource.
{{% /note %}}
{{% /warn %}}
Use the following command flags to identify
[partition template parts](/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/#tag-part-templates):
@ -69,7 +69,7 @@ Otherwise, InfluxDB omits time from the partition template and won't compact par
The following example creates a new `example-db` database and applies a partition
template that partitions by distinct values of two tags (`room` and `sensor-type`),
bucketed values of the `customerID` tag, and by week using the time format `%Y wk:%W`:
bucketed values of the `customerID` tag, and by day using the time format `%Y-%m-%d`:
<!--Skip database create and delete tests: namespaces aren't reusable-->
<!--pytest.mark.skip-->
@ -79,7 +79,7 @@ influxctl database create \
--template-tag room \
--template-tag sensor-type \
--template-tag-bucket customerID,500 \
--template-timeformat '%Y wk:%W' \
--template-timeformat '%Y-%m-%d' \
example-db
```
@ -150,22 +150,21 @@ prod,line=A,station=weld1 temp=81.9,qty=36i 1704067200000000000
##### Partitioning by distinct tag values
| Description | Tag parts | Time part | Resulting partition key |
| Description | Tag parts | Time part | Resulting partition key |
| :---------------------- | :---------------- | :--------- | :----------------------- |
| By day (default) | | `%Y-%m-%d` | 2024-01-01 |
| By day (non-default) | | `%d %b %Y` | 01 Jan 2024 |
| By week | | `%Y wk:%W` | 2024 wk:01 |
| By month | | `%Y-%m` | 2024-01 |
| Single tag, by day | `line` | `%F` | A \| 2024-01-01 |
| Single tag, by week | `line` | `%Y wk:%W` | A \| 2024 wk:01 |
| By year | | `%Y` | 2024 |
| Single tag, by day | `line` | `%Y-%m-%d` | A \| 2024-01-01 |
| Single tag, by month | `line` | `%Y-%m` | A \| 2024-01 |
| Multiple tags, by day | `line`, `station` | `%F` | A \| weld1 \| 2024-01-01 |
| Multiple tags, by week | `line`, `station` | `%Y wk:%W` | A \| weld1 \| 2024 wk:01 |
| Single tag, by year | `line` | `%Y` | A \| 2024 |
| Multiple tags, by day | `line`, `station` | `%Y-%m-%d` | A \| weld1 \| 2024-01-01 |
| Multiple tags, by month | `line`, `station` | `%Y-%m` | A \| weld1 \| 2024-01 |
| Multiple tags, by year | `line`, `station` | `%Y` | A \| weld1 \| 2024 |
##### Partition by tag buckets
| Description | Tag part | Tag bucket part | Time part | Resulting partition key |
| :--------------------------------- | :------- | :-------------- | :--------- | :---------------------- |
| Distinct tag, tag buckets, by day | `line` | `station,100` | `%F` | A \| 3 \| 2024-01-01 |
| Distinct tag, tag buckets, by week | `line` | `station,500` | `%Y wk:%W` | A \| 303 \| 2024 wk:01 |
| Description | Tag part | Tag bucket part | Time part | Resulting partition key |
| :---------------------------------- | :------- | :-------------- | :--------- | :---------------------- |
| Distinct tag, tag buckets, by day | `line` | `station,100` | `%Y-%m-%d` | A \| 3 \| 2024-01-01 |
| Distinct tag, tag buckets, by month | `line` | `station,500` | `%Y-%m` | A \| 303 \| 2024-01 |

View File

@ -39,11 +39,6 @@ and only 1 time part.
- [Tag part templates](#tag-part-templates)
- [Tag bucket part templates](#tag-bucket-part-templates)
- [Time part templates](#time-part-templates)
- [Date specifiers](#date-specifiers)
- [Time specifiers](#time-specifiers)
- [Time zone specifiers](#time-zone-specifiers)
- [Date and time specifiers](#date-and-time-specifiers)
- [Special specifiers](#special-specifiers)
<!-- /TOC -->
## Restrictions
@ -109,175 +104,16 @@ unknown number of distinct values.
## Time part templates
Time part templates use [Rust strftime date and time formatting syntax](https://docs.rs/chrono/latest/chrono/format/strftime/index.html)
Time part templates use a limited subset of the
[Rust strftime date and time formatting syntax](https://docs.rs/chrono/latest/chrono/format/strftime/index.html)
to specify time format in partition keys.
The smallest unit of time included in the time part template is the interval
used to partition data.
{{% warn %}}
#### Avoid partitioning by less than one day
We do not recommend using time intervals less than one day to partition data.
This can result in [over-partitioned data](/influxdb/cloud-dedicated/admin/custom-partitions/best-practices/#avoid-over-partitioning)
and may hurt query performance.
{{% /warn %}}
- [Date specifiers](#date-specifiers)
- [Time specifiers](#time-specifiers)
- [Time zone specifiers](#time-zone-specifiers)
- [Date and time specifiers](#date-and-time-specifiers)
- [Special specifiers](#special-specifiers)
{{% note %}}
The following is adapted from the
[Rust strftime source code](https://docs.rs/chrono/latest/src/chrono/format/strftime.rs.html).
{{% /note %}}
InfluxDB uses the smallest unit of time included in the time part template as
the partition interval.
### Date specifiers
| Variable | Example | Description |
| :------: | :--------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `%Y` | `2001` | The full proleptic Gregorian year, zero-padded to 4 digits. chrono supports years from -262144 to 262143. Note: years before 1 BCE or after 9999 CE, require an initial sign (+/-). |
| `%C` | `20` | The proleptic Gregorian year divided by 100, zero-padded to 2 digits. [^1] |
| `%y` | `01` | The proleptic Gregorian year modulo 100, zero-padded to 2 digits. [^1] |
| `%m` | `07` | Month number (01--12), zero-padded to 2 digits. |
| `%b` | `Jul` | Abbreviated month name. Always 3 letters. |
| `%B` | `July` | Full month name. Also accepts corresponding abbreviation in parsing. |
| `%h` | `Jul` | Same as `%b`. |
| `%d` | `08` | Day number (01--31), zero-padded to 2 digits. |
| `%e` | ` 8` | Same as `%d` but space-padded. Same as `%_d`. |
| `%a` | `Sun` | Abbreviated weekday name. Always 3 letters. |
| `%A` | `Sunday` | Full weekday name. Also accepts corresponding abbreviation in parsing. |
| `%w` | `0` | Sunday = 0, Monday = 1, ..., Saturday = 6. |
| `%u` | `7` | Monday = 1, Tuesday = 2, ..., Sunday = 7. (ISO 8601) |
| `%U` | `28` | Week number starting with Sunday (00--53), zero-padded to 2 digits. [^2] |
| `%W` | `27` | Same as `%U`, but week 1 starts with the first Monday in that year instead. |
| `%G` | `2001` | Same as `%Y` but uses the year number in ISO 8601 week date. [^3] |
| `%g` | `01` | Same as `%y` but uses the year number in ISO 8601 week date. [^3] |
| `%V` | `27` | Same as `%U` but uses the week number in ISO 8601 week date (01--53). [^3] |
| `%j` | `189` | Day of the year (001--366), zero-padded to 3 digits. |
| `%D` | `07/08/01` | Month-day-year format. Same as `%m/%d/%y`. |
| `%x` | `07/08/01` | Locale's date representation (e.g., 12/31/99). |
| `%F` | `2001-07-08` | Year-month-day format (ISO 8601). Same as `%Y-%m-%d`. |
| `%v` | ` 8-Jul-2001` | Day-month-year format. Same as `%e-%b-%Y`. |
### Time specifiers
| Variable | Example | Description |
| :------: | :--------------------------------- | :----------------------------------------------------------------------------------------------------------------------- |
| `%H` | `00` | Hour number (00--23), zero-padded to 2 digits. |
| `%k` | ` 0` | Same as `%H` but space-padded. Same as `%_H`. |
| `%I` | `12` | Hour number in 12-hour clocks (01--12), zero-padded to 2 digits. |
| `%l` | `12` | Same as `%I` but space-padded. Same as `%_I`. |
| `%P` | `am` | `am` or `pm` in 12-hour clocks. |
| `%p` | `AM` | `AM` or `PM` in 12-hour clocks. |
| `%M` | `34` | Minute number (00--59), zero-padded to 2 digits. |
| `%S` | `60` | Second number (00--60), zero-padded to 2 digits. [^4] |
| `%f` | `26490000` | Number of nanoseconds since last whole second. [^7] |
| `%.f` | `.026490` | Decimal fraction of a second. Consumes the leading dot. [^7] |
| `%.3f` | `.026` | Decimal fraction of a second with a fixed length of 3. |
| `%.6f` | `.026490` | Decimal fraction of a second with a fixed length of 6. |
| `%.9f` | `.026490000` | Decimal fraction of a second with a fixed length of 9. |
| `%3f` | `026` | Decimal fraction of a second like `%.3f` but without the leading dot. |
| `%6f` | `026490` | Decimal fraction of a second like `%.6f` but without the leading dot. |
| `%9f` | `026490000` | Decimal fraction of a second like `%.9f` but without the leading dot. |
| `%R` | `00:34` | Hour-minute format. Same as `%H:%M`. |
| `%T` | `00:34:60` | Hour-minute-second format. Same as `%H:%M:%S`. |
| `%X` | `00:34:60` | Locale's time representation (e.g., 23:13:48). |
| `%r` | `12:34:60 AM` | Locale's 12 hour clock time. (e.g., 11:11:04 PM). Falls back to `%X` if the locale does not have a 12 hour clock format. |
### Time zone specifiers
| Variable | Example | Description |
| :------: | :--------------------------------- | :----------------------------------------------------------------------------------------------------------------- |
| `%Z` | `ACST` | Local time zone name. Skips all non-whitespace characters during parsing. Identical to `%:z` when formatting. [^8] |
| `%z` | `+0930` | Offset from the local time to UTC (with UTC being `+0000`). |
| `%:z` | `+09:30` | Same as `%z` but with a colon. |
| `%::z` | `+09:30:00` | Offset from the local time to UTC with seconds. |
| `%:::z` | `+09` | Offset from the local time to UTC without minutes. |
| `%#z` | `+09` | *Parsing only:* Same as `%z` but allows minutes to be missing or present. |
### Date and time specifiers
| Variable | Example | Description |
| :------: | :--------------------------------- | :--------------------------------------------------------------------- |
| `%c` | `Sun Jul 8 00:34:60 2001` | Locale's date and time (e.g., Thu Mar 3 23:05:25 2005). |
| `%+` | `2001-07-08T00:34:60.026490+09:30` | ISO 8601 / RFC 3339 date & time format. [^5] |
| `%s` | `994518299` | UNIX timestamp, the number of seconds since 1970-01-01 00:00 UTC. [^6] |
### Special specifiers
| Variable | Example | Description |
| :------: | :------ | :---------------------- |
| `%t` | | Literal tab (`\t`). |
| `%n` | | Literal newline (`\n`). |
| `%%` | | Literal percent sign. |
It is possible to override the default padding behavior of numeric specifiers `%?`.
This is not allowed for other specifiers and results in the `BAD_FORMAT` error.
Modifier | Description
-------- | -----------
`%-?` | Suppresses any padding including spaces and zeroes. (e.g. `%j` = `012`, `%-j` = `12`)
`%_?` | Uses spaces as a padding. (e.g. `%j` = `012`, `%_j` = ` 12`)
`%0?` | Uses zeroes as a padding. (e.g. `%e` = ` 9`, `%0e` = `09`)
Notes:
[^1]: `%C`, `%y`:
This is floor division, so 100 BCE (year number -99) will print `-1` and `99` respectively.
[^2]: `%U`:
Week 1 starts with the first Sunday in that year.
It is possible to have week 0 for days before the first Sunday.
[^3]: `%G`, `%g`, `%V`:
Week 1 is the first week with at least 4 days in that year.
Week 0 does not exist, so this should be used with `%G` or `%g`.
[^4]: `%S`:
It accounts for leap seconds, so `60` is possible.
[^5]: `%+`: Same as `%Y-%m-%dT%H:%M:%S%.f%:z`, i.e. 0, 3, 6 or 9 fractional
digits for seconds and colons in the time zone offset.
<br>
<br>
This format also supports having a `Z` or `UTC` in place of `%:z`. They
are equivalent to `+00:00`.
<br>
<br>
Note that all `T`, `Z`, and `UTC` are parsed case-insensitively.
<br>
<br>
The typical `strftime` implementations have different (and locale-dependent)
formats for this specifier. While Chrono's format for `%+` is far more
stable, it is best to avoid this specifier if you want to control the exact
output.
[^6]: `%s`:
This is not padded and can be negative.
For the purpose of Chrono, it only accounts for non-leap seconds
so it slightly differs from ISO C `strftime` behavior.
[^7]: `%f`, `%.f`:
<br>
`%f` and `%.f` are notably different formatting specifiers.<br>
`%f` counts the number of nanoseconds since the last whole second, while `%.f` is a fraction of a
second.<br>
Example: 7μs is formatted as `7000` with `%f`, and formatted as `.000007` with `%.f`.
[^8]: `%Z`:
Since `chrono` is not aware of timezones beyond their offsets, this specifier
**only prints the offset** when used for formatting. The timezone abbreviation
will NOT be printed. See [this issue](https://github.com/chronotope/chrono/issues/960)
for more information.
<br>
<br>
Offset will not be populated from the parsed data, nor will it be validated.
Timezone is completely ignored. Similar to the glibc `strptime` treatment of
this format code.
<br>
<br>
It is not possible to reliably convert from an abbreviation to an offset,
for example CDT can mean either Central Daylight Time (North America) or
China Daylight Time.
*/
| Variable | Example | Description |
| :------: | :----------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `%Y` | `2001` | The full proleptic Gregorian year, zero-padded to 4 digits. chrono supports years from -262144 to 262143. Note: years before 1 BCE or after 9999 CE, require an initial sign (+/-). |
| `%m` | `07` | Month number (01--12), zero-padded to 2 digits. |
| `%d` | `08` | Day number (01--31), zero-padded to 2 digits. |

View File

@ -0,0 +1,198 @@
---
title: View partition information
description: >
Query partition information from InfluxDB v3 system tables to view partition
templates and verify partitions are working as intended.
menu:
influxdb_cloud_dedicated:
name: View partitions
parent: Manage data partitioning
weight: 202
list_code_example: |
```sql
SELECT * FROM system.partitions WHERE table_name = 'example-table'
```
related:
- /influxdb/cloud-dedicated/admin/query-system-data/
---
{{< product-name >}} stores partition information in InfluxDB v3 system tables.
Query partition information to view partition templates and verify partitions
are working as intended.
- [Query partition information from system tables](#query-partition-information-from-system-tables)
- [Partition-related queries](#partition-related-queries)
{{% warn %}}
#### Querying system tables may impact overall cluster performance
Partition information is stored in InfluxDB v3 system tables.
Querying system tables may impact the overall write and query performance of
your {{< product-name omit=" Clustered" >}} cluster.
<!--------------- UPDATE THE DATE BELOW AS EXAMPLES ARE UPDATED --------------->
#### System tables are subject to change
System tables are not part of InfluxDB's stable API and may change with new releases.
The provided schema information and query examples are valid as of **August 22, 2024**.
If you detect a schema change or a non-functioning query example, please
[submit an issue](https://github.com/influxdata/docs-v2/issues/new/choose).
<!--------------- UPDATE THE DATE ABOVE AS EXAMPLES ARE UPDATED --------------->
{{% /warn %}}
## Query partition information from system tables
Use the [`influxctl query` command](/influxdb/cloud-dedicated/reference/cli/influxctl/query/)
and SQL to query partition-related information from InfluxDB system tables.
Provide the following:
- **Enable system tables** with the `--enable-system-tables` command flag.
- **Database token**: A [database token](/influxdb/cloud-dedicated/admin/tokens/#database-tokens)
with read permissions on the specified database. Uses the `token` setting from
the [`influxctl` connection profile](/influxdb/cloud-dedicated/reference/cli/influxctl/#configure-connection-profiles)
or the `--token` command flag.
- **Database name**: The name of the database to query information about.
Uses the `database` setting from the
[`influxctl` connection profile](/influxdb/cloud-dedicated/reference/cli/influxctl/#configure-connection-profiles)
or the `--database` command flag.
- **SQL query**: The SQL query to execute.
Pass the query in one of the following ways:
- a string on the command line
- a path to a file that contains the query
- a single dash (`-`) to read the query from stdin
{{% code-placeholders "DATABASE_(TOKEN|NAME)|SQL_QUERY" %}}
```bash
influxctl query \
--enable-system-tables \
--database DATABASE_NAME \
--token DATABASE_TOKEN \
"SQL_QUERY"
```
{{% /code-placeholders %}}
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}:
A database token with read access to the specified database
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}:
The name of the database to query information about.
- {{% code-placeholder-key %}}`SQL_QUERY`{{% /code-placeholder-key %}}:
The SQL query to execute. For examples, see
[System query examples](#system-query-examples).
When prompted, enter `y` to acknowledge the potential impact querying system
tables may have on your cluster.
## Partition-related queries
Use the following queries to return information about partitions in your
{{< product-name omit=" Clustered" >}} cluster.
- [View partition templates of all tables](#view-partition-templates-of-all-tables)
- [View the partition template of a specific table](#view-the-partition-template-of-a-specific-table)
- [View all partitions for a table](#view-all-partitions-for-a-table)
- [View the number of partitions per table](#view-the-number-of-partitions-per-table)
- [View the number of partitions for a specific table](#view-the-number-of-partitions-for-a-specific-table)
---
In the examples below, replace {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}
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 %}}
### View the partition template of a specific table
```sql
SELECT * FROM system.tables WHERE table_name = 'TABLE_NAME'
```
#### Example results
| table_name | partition_template |
| :--------- | :----------------------------------------------------------------------------------------- |
| weather | `{"parts":[{"timeFormat":"%Y-%m-%d"},{"bucket":{"tagName":"location","numBuckets":250}}]}` |
### View all partitions for a table
```sql
SELECT * FROM system.partitions WHERE table_name = 'TABLE_NAME'
```
### Example results
| partition_id | table_name | partition_key | last_new_file_created_at | num_files | total_size_mb |
| -----------: | :--------- | :---------------- | -----------------------: | --------: | ------------: |
| 1362 | weather | 43 \| 2020-05-27 | 1683747418763813713 | 1 | 0 |
| 800 | weather | 234 \| 2021-08-02 | 1683747421899400796 | 1 | 0 |
| 630 | weather | 325 \| 2022-03-17 | 1683747417616689036 | 1 | 0 |
| 1401 | weather | 12 \| 2021-01-09 | 1683747417786122295 | 1 | 0 |
| 1012 | weather | 115 \| 2022-07-04 | 1683747417614219148 | 1 | 0 |
### View the number of partitions per table
```sql
SELECT
table_name,
COUNT(*) AS partition_count
FROM
system.partitions
GROUP BY
table_name
```
### Example results
| table_name | partition_count |
| :--------- | --------------: |
| weather | 1096 |
| home | 24 |
| numbers | 1 |
### View the number of partitions for a specific table
```sql
SELECT
COUNT(*) AS partition_count
FROM
system.partitions
WHERE
table_name = 'TABLE_NAME'
```
### Example results
| table_name | partition_count |
| :--------- | --------------: |
| weather | 1096 |
{{% /code-placeholders %}}

View File

@ -194,14 +194,6 @@ flags to define partition template parts used to generate partition keys for the
For more information, see [Manage data partitioning](/influxdb/cloud-dedicated/admin/custom-partitions/).
{{% note %}}
#### Partition templates can only be applied on create
You can only apply a partition template when creating a database.
You can't update a partition template on an existing database.
{{% /note %}}
<!-------------------------------- END INFLUXCTL ------------------------------>
{{% /tab-content %}}
{{% tab-content %}}
@ -235,7 +227,7 @@ _This example uses [cURL](https://curl.se/) to send a Management HTTP API reques
to use in the partition template. Limit is 7 total tags or tag buckets.
- _Optional_: [InfluxDB tag buckets](/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/#tag-bucket-part-templates)
to use in the partition template. Limit is 7 total tags or tag buckets.
- _Optional_: A [Rust strftime date and time string](/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/#time-part-templates)
- _Optional_: A supported [Rust strftime date and time string](/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/#time-part-templates)
that specifies the time format in the partition template and determines
the time interval to partition by. Default is `%Y-%m-%d`.
- Database name _(see [Database naming restrictions](#database-naming-restrictions))_.
@ -341,21 +333,23 @@ format in the InfluxDB v3 storage engine. By default, data is partitioned by day
but, depending on your schema and workload, customizing the partitioning
strategy can improve query performance.
Use the [`partitionTemplate`](/influxdb/cloud-dedicated/api/management/#operation/CreateClusterDatabase) property to define an array of partition template parts used to generate partition keys for the database.
Use the [`partitionTemplate`](/influxdb/cloud-dedicated/api/management/#operation/CreateClusterDatabase)
property to define an array of partition template parts used to generate
partition keys for the database.
For more information, see [Manage data partitioning](/influxdb/cloud-dedicated/admin/custom-partitions/).
{{% note %}}
<!------------------------------- END cURL ------------------------------------>
{{% /tab-content %}}
{{< /tabs-wrapper >}}
{{% warn %}}
#### Partition templates can only be applied on create
You can only apply a partition template when creating a database.
You can't update a partition template on an existing database.
{{% /note %}}
<!------------------------------- END cURL ------------------------------------>
{{% /tab-content %}}
{{< /tabs-wrapper >}}
{{% /warn %}}
### Database naming restrictions

View File

@ -31,7 +31,7 @@ performance of your {{< product-name omit=" Clustered" >}} cluster.
#### System tables are subject to change
System tables are not part of InfluxDB's stable API and may change with new releases.
The provided schema information and query examples are valid as of **April 11, 2024**.
The provided schema information and query examples are valid as of **August 22, 2024**.
If you detect a schema change or a non-functioning query example, please
[submit an issue](https://github.com/influxdata/docs-v2/issues/new/choose).

View File

@ -34,7 +34,7 @@ to a table, you must manually create the table before you write any data to it.
to use in the partition template
- _Optional_: [InfluxDB tag buckets](/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/#tag-bucket-part-templates)
to use in the partition template
- _Optional_: A [Rust strftime date and time string](/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/#time-part-templates)
- _Optional_: A supported [Rust strftime date and time string](/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/#time-part-templates)
that specifies the time format in the partition template and determines
the time interval to partition by _(default is `%Y-%m-%d`)_
- The name of the database to create the table in
@ -71,9 +71,9 @@ If no template flags are provided, the table uses the partition template of the
target database.
For more information, see [Manage data partitioning](/influxdb/cloud-dedicated/admin/custom-partitions/).
{{% note %}}
{{% warn %}}
#### Partition templates can only be applied on create
You can only apply a partition template when creating a table.
There is no way to update a partition template on an existing table.
{{% /note %}}
{{% /warn %}}

View File

@ -32,6 +32,7 @@ influxctl [flags] [command]
| Command | Description |
| :-------------------------------------------------------------------------- | :------------------------------------- |
| [auth](/influxdb/cloud-dedicated/reference/cli/influxctl/auth/) | Log in to or log out of InfluxDB v3 |
| [cluster](/influxdb/cloud-dedicated/reference/cli/influxctl/cluster/) | List InfluxDB v3 cluster information |
| [database](/influxdb/cloud-dedicated/reference/cli/influxctl/database/) | Manage InfluxDB v3 databases |
| [help](/influxdb/cloud-dedicated/reference/cli/influxctl/help/) | Output `influxctl` help information |

View File

@ -0,0 +1,32 @@
---
title: influxctl auth
description: >
The `influxctl auth` command and its subcommands let a user
log in to and log out of an InfluxDB cluster.
menu:
influxdb_cloud_dedicated:
parent: influxctl
weight: 201
---
The `influxctl auth` command and its subcommands let a user log in to and log out of an {{< product-name omit="Clustered" >}} cluster.
## Usage
```sh
influxctl auth [subcommand] [subcommand options] [arguments...]
```
## Subcommands
| Subcommand | Description |
| :----------------------------------------------------------------------- | :------------------------------ |
| [login](/influxdb/cloud-dedicated/reference/cli/influxctl/auth/login/) | Log in to an InfluxDB cluster using InfluxData Auth0 |
| [logout](/influxdb/cloud-dedicated/reference/cli/influxctl/auth/logout/) | Log out of an InfluxDB cluster; remove local authorization tokens |
| help, h | Output command help |
## Flags
| Flag | | Description |
| :--- | :------- | :------------------ |
| `-h` | `--help` | Output command help |

View File

@ -0,0 +1,29 @@
---
title: influxctl auth login
description: >
The `influxctl auth login` command lets a user log in to an InfluxDB cluster using
the InfluxDB Cloud Dedicated identity provider.
menu:
influxdb_cloud_dedicated:
parent: influxctl auth
weight: 301
---
The `influxctl auth login` command lets a user log in to an {{< product-name omit="Clustered" >}}
cluster using InfluxData Auth0.
## Usage
```sh
influxctl auth login
```
## Flags
| Flag | | Description |
| :--- | :--------- | :-------------------------------------------- |
| `-h` | `--help` | Output command help |
{{% caption %}}
_Also see [`influxctl` global flags](/influxdb/cloud-dedicated/reference/cli/influxctl/#global-flags)._
{{% /caption %}}

View File

@ -0,0 +1,29 @@
---
title: influxctl auth logout
description: >
The `influxctl auth logout` command lets a user log out of an InfluxDB
cluster and removes the user's local authorization tokens.
menu:
influxdb_cloud_dedicated:
parent: influxctl auth
weight: 301
---
The `influxctl auth logout` command lets a user log out of an {{< product-name omit="Clustered" >}}
cluster and removes the user's local authorization tokens.
## Usage
```sh
influxctl auth logout
```
## Flags
| Flag | | Description |
| :--- | :--------- | :-------------------------------------------- |
| `-h` | `--help` | Output command help |
{{% caption %}}
_Also see [`influxctl` global flags](/influxdb/cloud-dedicated/reference/cli/influxctl/#global-flags)._
{{% /caption %}}

View File

@ -156,8 +156,8 @@ influxctl database create \
### Create a database with a custom partition template
The following example creates a new `mydb` database and applies a partition
template that partitions by two tags (`room` and `sensor-type`) and by week using
the time format `%Y wk:%W`:
template that partitions by two tags (`room` and `sensor-type`) and by day using
the time format `%Y-%m-%d`:
<!--Skip tests for database create and delete: namespaces aren't reusable-->
<!--pytest.mark.skip-->
@ -167,7 +167,7 @@ influxctl database create \
--template-tag room \
--template-tag sensor-type \
--template-tag-bucket customerID,1000 \
--template-timeformat '%Y wk:%W' \
--template-timeformat '%Y-%m-%d' \
mydb
```

View File

@ -82,8 +82,8 @@ influxctl table create DATABASE_NAME TABLE_NAME
### Create a table with a custom partition template
The following example creates a new table and applies a partition
template that partitions by two tags (`room` and `sensor-type`) and by week using
the time format `%Y wk:%W`:
template that partitions by two tags (`room` and `sensor-type`) and by day using
the time format `%Y-%m-%d`:
{{% code-placeholders "(DATABASE|TABLE)_NAME" %}}
```sh
@ -91,7 +91,7 @@ influxctl table create \
--template-tag room \
--template-tag sensor-type \
--template-tag-bucket customerID,1000 \
--template-timeformat '%Y wk:%W' \
--template-timeformat '%Y-%m-%d' \
DATABASE_NAME \
TABLE_NAME
```

View File

@ -11,6 +11,24 @@ menu:
weight: 202
---
## v2.9.6 {date="2024-08-15"}
### Bug Fixes
- Update query to wait for EOF on stdin instead of the first newline.
## v2.9.5 {date="2024-08-13"}
### Bug Fixes
- Introduce auth login and logout commands.
### Dependency Updates
- Update `github.com/urfave/cli/v2` from 2.27.2 to 2.27.4
- Update `golang.org/x/mod` from 0.19.0 to 0.20.0
- Update `golang.org/x/oauth2` from 0.21.0 to 0.22.0
## v2.9.4 {date="2024-07-25"}
### Bug Fixes

View File

@ -12,6 +12,18 @@ alt_links:
cloud: /influxdb/cloud/account-management/billing/
---
{{% warn %}}
#### Possible inaccurate or incomplete data usage reports
The Cloud Serverless and Cloud 2 UI **Usage** page is currently experiencing an
issue that may cause the data usage reports to be inaccurate or incomplete.
Please note that actual billing records are not affected.
Our team is actively working to resolve this issue.
We apologize for any inconvenience and appreciate your patience.
{{% /warn %}}
Learn how to upgrade your plan, access billing details, and review and resolve plan limit overages:
- [Upgrade to Usage-Based Plan](#upgrade-to-usage-based-plan)

View File

@ -17,6 +17,18 @@ aliases:
- /influxdb/cloud-serverless/admin/accounts/data-usage/
---
{{% warn %}}
#### Possible inaccurate or incomplete data usage reports
The Cloud Serverless and Cloud 2 UI **Usage** page is currently experiencing an
issue that may cause the data usage reports to be inaccurate or incomplete.
Please note that actual billing records are not affected.
Our team is actively working to resolve this issue.
We apologize for any inconvenience and appreciate your patience.
{{% /warn %}}
View the statistics of your data usage and rate limits (reads and writes) on the
InfluxDB Cloud Serverless UI **Usage** page.
For more information, see [limits and adjustable quotas](/influxdb/cloud-serverless/admin/billing/limits/).

View File

@ -17,6 +17,18 @@ alt_links:
cloud-serverless: /influxdb/cloud-serverless/admin/billing/
---
{{% warn %}}
#### Possible inaccurate or incomplete data usage reports
The Cloud Serverless and Cloud 2 UI **Usage** page is currently experiencing an
issue that may cause the data usage reports to be inaccurate or incomplete.
Please note that actual billing records are not affected.
Our team is actively working to resolve this issue.
We apologize for any inconvenience and appreciate your patience.
{{% /warn %}}
Learn how to upgrade your plan, access billing details, and review and resolve plan limit overages:
- [Upgrade to Usage-Based Plan](#upgrade-to-usage-based-plan)

View File

@ -18,6 +18,18 @@ alt_links:
cloud-serverless: /influxdb/cloud-serverless/admin/billing/data-usage/
---
{{% warn %}}
#### Possible inaccurate or incomplete data usage reports
The Cloud Serverless and Cloud 2 UI **Usage** page is currently experiencing an
issue that may cause the data usage reports to be inaccurate or incomplete.
Please note that actual billing records are not affected.
Our team is actively working to resolve this issue.
We apologize for any inconvenience and appreciate your patience.
{{% /warn %}}
View the statistics of your data usage and rate limits (reads, writes, and delete limits) on the Usage page. Some usage data affects monthly costs ([pricing vectors](/influxdb/cloud/account-management/pricing-plans/#pricing-vectors)) and other usage data (for example, delete limits), does not affect pricing. For more information, see the [InfluxDB Cloud limits and adjustable quotas](/influxdb/cloud/account-management/limits/).
To view your {{< product-name >}} data usage, do the following:

View File

@ -47,12 +47,9 @@ As you plan your partitioning strategy, keep in mind that data can be
having to retrieve and read many partitions from the object store, which
hurts query performance.
- Avoid using partition time intervals that are **less than one day**.
The partition time interval should be balanced with the actual amount of data
written during each interval. If a single interval doesn't contain a lot of data,
- Balance the partition time interval with the actual amount of data written
during each interval. If a single interval doesn't contain a lot of data,
it is better to partition by larger time intervals.
- Don't partition by tags that you typically don't use in your query workload.
- Don't partition by distinct values of high-cardinality tags.
Instead, [use tag buckets](#use-tag-buckets-for-high-cardinality-tags) to

View File

@ -28,13 +28,13 @@ table.
- [Create a table with a custom partition template](#create-a-table-with-a-custom-partition-template)
- [Example partition templates](#example-partition-templates)
{{% note %}}
{{% warn %}}
#### Partition templates can only be applied on create
You can only apply a partition template when creating a database or table.
You can't update a partition template on an existing resource.
{{% /note %}}
{{% /warn %}}
Use the following command flags to identify
[partition template parts](/influxdb/clustered/admin/custom-partitions/partition-templates/#tag-part-templates):
@ -69,7 +69,7 @@ Otherwise, InfluxDB omits time from the partition template and won't compact par
The following example creates a new `example-db` database and applies a partition
template that partitions by distinct values of two tags (`room` and `sensor-type`),
bucketed values of the `customerID` tag, and by week using the time format `%Y wk:%W`:
bucketed values of the `customerID` tag, and by day using the time format `%Y-%m-%d`:
<!--Skip database create and delete tests: namespaces aren't reusable-->
<!--pytest.mark.skip-->
@ -79,7 +79,7 @@ influxctl database create \
--template-tag room \
--template-tag sensor-type \
--template-tag-bucket customerID,500 \
--template-timeformat '%Y wk:%W' \
--template-timeformat '%Y-%m-%d' \
example-db
```
@ -150,22 +150,21 @@ prod,line=A,station=weld1 temp=81.9,qty=36i 1704067200000000000
##### Partitioning by distinct tag values
| Description | Tag parts | Time part | Resulting partition key |
| Description | Tag parts | Time part | Resulting partition key |
| :---------------------- | :---------------- | :--------- | :----------------------- |
| By day (default) | | `%Y-%m-%d` | 2024-01-01 |
| By day (non-default) | | `%d %b %Y` | 01 Jan 2024 |
| By week | | `%Y wk:%W` | 2024 wk:01 |
| By month | | `%Y-%m` | 2024-01 |
| Single tag, by day | `line` | `%F` | A \| 2024-01-01 |
| Single tag, by week | `line` | `%Y wk:%W` | A \| 2024 wk:01 |
| By year | | `%Y` | 2024 |
| Single tag, by day | `line` | `%Y-%m-%d` | A \| 2024-01-01 |
| Single tag, by month | `line` | `%Y-%m` | A \| 2024-01 |
| Multiple tags, by day | `line`, `station` | `%F` | A \| weld1 \| 2024-01-01 |
| Multiple tags, by week | `line`, `station` | `%Y wk:%W` | A \| weld1 \| 2024 wk:01 |
| Single tag, by year | `line` | `%Y` | A \| 2024 |
| Multiple tags, by day | `line`, `station` | `%Y-%m-%d` | A \| weld1 \| 2024-01-01 |
| Multiple tags, by month | `line`, `station` | `%Y-%m` | A \| weld1 \| 2024-01 |
| Multiple tags, by year | `line`, `station` | `%Y` | A \| weld1 \| 2024 |
##### Partition by tag buckets
| Description | Tag part | Tag bucket part | Time part | Resulting partition key |
| :--------------------------------- | :------- | :-------------- | :--------- | :---------------------- |
| Distinct tag, tag buckets, by day | `line` | `station,100` | `%F` | A \| 3 \| 2024-01-01 |
| Distinct tag, tag buckets, by week | `line` | `station,500` | `%Y wk:%W` | A \| 303 \| 2024 wk:01 |
| Description | Tag part | Tag bucket part | Time part | Resulting partition key |
| :---------------------------------- | :------- | :-------------- | :--------- | :---------------------- |
| Distinct tag, tag buckets, by day | `line` | `station,100` | `%Y-%m-%d` | A \| 3 \| 2024-01-01 |
| Distinct tag, tag buckets, by month | `line` | `station,500` | `%Y-%m` | A \| 303 \| 2024-01 |

View File

@ -39,11 +39,6 @@ and only 1 time part.
- [Tag part templates](#tag-part-templates)
- [Tag bucket part templates](#tag-bucket-part-templates)
- [Time part templates](#time-part-templates)
- [Date specifiers](#date-specifiers)
- [Time specifiers](#time-specifiers)
- [Time zone specifiers](#time-zone-specifiers)
- [Date and time specifiers](#date-and-time-specifiers)
- [Special specifiers](#special-specifiers)
<!-- /TOC -->
## Restrictions
@ -109,175 +104,16 @@ unknown number of distinct values.
## Time part templates
Time part templates use [Rust strftime date and time formatting syntax](https://docs.rs/chrono/latest/chrono/format/strftime/index.html)
Time part templates use a limited subset of the
[Rust strftime date and time formatting syntax](https://docs.rs/chrono/latest/chrono/format/strftime/index.html)
to specify time format in partition keys.
The smallest unit of time included in the time part template is the interval
used to partition data.
{{% warn %}}
#### Avoid partitioning by less than one day
We do not recommend using time intervals less than one day to partition data.
This can result in [over-partitioned data](/influxdb/clustered/admin/custom-partitions/best-practices/#avoid-over-partitioning)
and may hurt query performance.
{{% /warn %}}
- [Date specifiers](#date-specifiers)
- [Time specifiers](#time-specifiers)
- [Time zone specifiers](#time-zone-specifiers)
- [Date and time specifiers](#date-and-time-specifiers)
- [Special specifiers](#special-specifiers)
{{% note %}}
The following is adapted from the
[Rust strftime source code](https://docs.rs/chrono/latest/src/chrono/format/strftime.rs.html).
{{% /note %}}
InfluxDB uses the smallest unit of time included in the time part template as
the partition interval.
### Date specifiers
| Variable | Example | Description |
| :------: | :--------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `%Y` | `2001` | The full proleptic Gregorian year, zero-padded to 4 digits. chrono supports years from -262144 to 262143. Note: years before 1 BCE or after 9999 CE, require an initial sign (+/-). |
| `%C` | `20` | The proleptic Gregorian year divided by 100, zero-padded to 2 digits. [^1] |
| `%y` | `01` | The proleptic Gregorian year modulo 100, zero-padded to 2 digits. [^1] |
| `%m` | `07` | Month number (01--12), zero-padded to 2 digits. |
| `%b` | `Jul` | Abbreviated month name. Always 3 letters. |
| `%B` | `July` | Full month name. Also accepts corresponding abbreviation in parsing. |
| `%h` | `Jul` | Same as `%b`. |
| `%d` | `08` | Day number (01--31), zero-padded to 2 digits. |
| `%e` | ` 8` | Same as `%d` but space-padded. Same as `%_d`. |
| `%a` | `Sun` | Abbreviated weekday name. Always 3 letters. |
| `%A` | `Sunday` | Full weekday name. Also accepts corresponding abbreviation in parsing. |
| `%w` | `0` | Sunday = 0, Monday = 1, ..., Saturday = 6. |
| `%u` | `7` | Monday = 1, Tuesday = 2, ..., Sunday = 7. (ISO 8601) |
| `%U` | `28` | Week number starting with Sunday (00--53), zero-padded to 2 digits. [^2] |
| `%W` | `27` | Same as `%U`, but week 1 starts with the first Monday in that year instead. |
| `%G` | `2001` | Same as `%Y` but uses the year number in ISO 8601 week date. [^3] |
| `%g` | `01` | Same as `%y` but uses the year number in ISO 8601 week date. [^3] |
| `%V` | `27` | Same as `%U` but uses the week number in ISO 8601 week date (01--53). [^3] |
| `%j` | `189` | Day of the year (001--366), zero-padded to 3 digits. |
| `%D` | `07/08/01` | Month-day-year format. Same as `%m/%d/%y`. |
| `%x` | `07/08/01` | Locale's date representation (e.g., 12/31/99). |
| `%F` | `2001-07-08` | Year-month-day format (ISO 8601). Same as `%Y-%m-%d`. |
| `%v` | ` 8-Jul-2001` | Day-month-year format. Same as `%e-%b-%Y`. |
### Time specifiers
| Variable | Example | Description |
| :------: | :--------------------------------- | :----------------------------------------------------------------------------------------------------------------------- |
| `%H` | `00` | Hour number (00--23), zero-padded to 2 digits. |
| `%k` | ` 0` | Same as `%H` but space-padded. Same as `%_H`. |
| `%I` | `12` | Hour number in 12-hour clocks (01--12), zero-padded to 2 digits. |
| `%l` | `12` | Same as `%I` but space-padded. Same as `%_I`. |
| `%P` | `am` | `am` or `pm` in 12-hour clocks. |
| `%p` | `AM` | `AM` or `PM` in 12-hour clocks. |
| `%M` | `34` | Minute number (00--59), zero-padded to 2 digits. |
| `%S` | `60` | Second number (00--60), zero-padded to 2 digits. [^4] |
| `%f` | `26490000` | Number of nanoseconds since last whole second. [^7] |
| `%.f` | `.026490` | Decimal fraction of a second. Consumes the leading dot. [^7] |
| `%.3f` | `.026` | Decimal fraction of a second with a fixed length of 3. |
| `%.6f` | `.026490` | Decimal fraction of a second with a fixed length of 6. |
| `%.9f` | `.026490000` | Decimal fraction of a second with a fixed length of 9. |
| `%3f` | `026` | Decimal fraction of a second like `%.3f` but without the leading dot. |
| `%6f` | `026490` | Decimal fraction of a second like `%.6f` but without the leading dot. |
| `%9f` | `026490000` | Decimal fraction of a second like `%.9f` but without the leading dot. |
| `%R` | `00:34` | Hour-minute format. Same as `%H:%M`. |
| `%T` | `00:34:60` | Hour-minute-second format. Same as `%H:%M:%S`. |
| `%X` | `00:34:60` | Locale's time representation (e.g., 23:13:48). |
| `%r` | `12:34:60 AM` | Locale's 12 hour clock time. (e.g., 11:11:04 PM). Falls back to `%X` if the locale does not have a 12 hour clock format. |
### Time zone specifiers
| Variable | Example | Description |
| :------: | :--------------------------------- | :----------------------------------------------------------------------------------------------------------------- |
| `%Z` | `ACST` | Local time zone name. Skips all non-whitespace characters during parsing. Identical to `%:z` when formatting. [^8] |
| `%z` | `+0930` | Offset from the local time to UTC (with UTC being `+0000`). |
| `%:z` | `+09:30` | Same as `%z` but with a colon. |
| `%::z` | `+09:30:00` | Offset from the local time to UTC with seconds. |
| `%:::z` | `+09` | Offset from the local time to UTC without minutes. |
| `%#z` | `+09` | *Parsing only:* Same as `%z` but allows minutes to be missing or present. |
### Date and time specifiers
| Variable | Example | Description |
| :------: | :--------------------------------- | :--------------------------------------------------------------------- |
| `%c` | `Sun Jul 8 00:34:60 2001` | Locale's date and time (e.g., Thu Mar 3 23:05:25 2005). |
| `%+` | `2001-07-08T00:34:60.026490+09:30` | ISO 8601 / RFC 3339 date & time format. [^5] |
| `%s` | `994518299` | UNIX timestamp, the number of seconds since 1970-01-01 00:00 UTC. [^6] |
### Special specifiers
| Variable | Example | Description |
| :------: | :------ | :---------------------- |
| `%t` | | Literal tab (`\t`). |
| `%n` | | Literal newline (`\n`). |
| `%%` | | Literal percent sign. |
It is possible to override the default padding behavior of numeric specifiers `%?`.
This is not allowed for other specifiers and results in the `BAD_FORMAT` error.
Modifier | Description
-------- | -----------
`%-?` | Suppresses any padding including spaces and zeroes. (e.g. `%j` = `012`, `%-j` = `12`)
`%_?` | Uses spaces as a padding. (e.g. `%j` = `012`, `%_j` = ` 12`)
`%0?` | Uses zeroes as a padding. (e.g. `%e` = ` 9`, `%0e` = `09`)
Notes:
[^1]: `%C`, `%y`:
This is floor division, so 100 BCE (year number -99) will print `-1` and `99` respectively.
[^2]: `%U`:
Week 1 starts with the first Sunday in that year.
It is possible to have week 0 for days before the first Sunday.
[^3]: `%G`, `%g`, `%V`:
Week 1 is the first week with at least 4 days in that year.
Week 0 does not exist, so this should be used with `%G` or `%g`.
[^4]: `%S`:
It accounts for leap seconds, so `60` is possible.
[^5]: `%+`: Same as `%Y-%m-%dT%H:%M:%S%.f%:z`, i.e. 0, 3, 6 or 9 fractional
digits for seconds and colons in the time zone offset.
<br>
<br>
This format also supports having a `Z` or `UTC` in place of `%:z`. They
are equivalent to `+00:00`.
<br>
<br>
Note that all `T`, `Z`, and `UTC` are parsed case-insensitively.
<br>
<br>
The typical `strftime` implementations have different (and locale-dependent)
formats for this specifier. While Chrono's format for `%+` is far more
stable, it is best to avoid this specifier if you want to control the exact
output.
[^6]: `%s`:
This is not padded and can be negative.
For the purpose of Chrono, it only accounts for non-leap seconds
so it slightly differs from ISO C `strftime` behavior.
[^7]: `%f`, `%.f`:
<br>
`%f` and `%.f` are notably different formatting specifiers.<br>
`%f` counts the number of nanoseconds since the last whole second, while `%.f` is a fraction of a
second.<br>
Example: 7μs is formatted as `7000` with `%f`, and formatted as `.000007` with `%.f`.
[^8]: `%Z`:
Since `chrono` is not aware of timezones beyond their offsets, this specifier
**only prints the offset** when used for formatting. The timezone abbreviation
will NOT be printed. See [this issue](https://github.com/chronotope/chrono/issues/960)
for more information.
<br>
<br>
Offset will not be populated from the parsed data, nor will it be validated.
Timezone is completely ignored. Similar to the glibc `strptime` treatment of
this format code.
<br>
<br>
It is not possible to reliably convert from an abbreviation to an offset,
for example CDT can mean either Central Daylight Time (North America) or
China Daylight Time.
*/
| Variable | Example | Description |
| :------: | :----------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `%Y` | `2001` | The full proleptic Gregorian year, zero-padded to 4 digits. chrono supports years from -262144 to 262143. Note: years before 1 BCE or after 9999 CE, require an initial sign (+/-). |
| `%m` | `07` | Month number (01--12), zero-padded to 2 digits. |
| `%d` | `08` | Day number (01--31), zero-padded to 2 digits. |

View File

@ -0,0 +1,198 @@
---
title: View partition information
description: >
Query partition information from InfluxDB v3 system tables to view partition
templates and verify partitions are working as intended.
menu:
influxdb_clustered:
name: View partitions
parent: Manage data partitioning
weight: 202
list_code_example: |
```sql
SELECT * FROM system.partitions WHERE table_name = 'example-table'
```
related:
- /influxdb/clustered/admin/query-system-data/
---
{{< product-name >}} stores partition information in InfluxDB v3 system tables.
Query partition information to view partition templates and verify partitions
are working as intended.
- [Query partition information from system tables](#query-partition-information-from-system-tables)
- [Partition-related queries](#partition-related-queries)
{{% warn %}}
#### Querying system tables may impact overall cluster performance
Partition information is stored in InfluxDB v3 system tables.
Querying system tables may impact the overall write and query performance of
your {{< product-name omit=" Clustered" >}} cluster.
<!--------------- UPDATE THE DATE BELOW AS EXAMPLES ARE UPDATED --------------->
#### System tables are subject to change
System tables are not part of InfluxDB's stable API and may change with new releases.
The provided schema information and query examples are valid as of **August 22, 2024**.
If you detect a schema change or a non-functioning query example, please
[submit an issue](https://github.com/influxdata/docs-v2/issues/new/choose).
<!--------------- UPDATE THE DATE ABOVE AS EXAMPLES ARE UPDATED --------------->
{{% /warn %}}
## Query partition information from system tables
Use the [`influxctl query` command](/influxdb/clustered/reference/cli/influxctl/query/)
and SQL to query partition-related information from InfluxDB system tables.
Provide the following:
- **Enable system tables** with the `--enable-system-tables` command flag.
- **Database token**: A [database token](/influxdb/clustered/admin/tokens/#database-tokens)
with read permissions on the specified database. Uses the `token` setting from
the [`influxctl` connection profile](/influxdb/clustered/reference/cli/influxctl/#configure-connection-profiles)
or the `--token` command flag.
- **Database name**: The name of the database to query information about.
Uses the `database` setting from the
[`influxctl` connection profile](/influxdb/clustered/reference/cli/influxctl/#configure-connection-profiles)
or the `--database` command flag.
- **SQL query**: The SQL query to execute.
Pass the query in one of the following ways:
- a string on the command line
- a path to a file that contains the query
- a single dash (`-`) to read the query from stdin
{{% code-placeholders "DATABASE_(TOKEN|NAME)|SQL_QUERY" %}}
```bash
influxctl query \
--enable-system-tables \
--database DATABASE_NAME \
--token DATABASE_TOKEN \
"SQL_QUERY"
```
{{% /code-placeholders %}}
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}:
A database token with read access to the specified database
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}:
The name of the database to query information about.
- {{% code-placeholder-key %}}`SQL_QUERY`{{% /code-placeholder-key %}}:
The SQL query to execute. For examples, see
[System query examples](#system-query-examples).
When prompted, enter `y` to acknowledge the potential impact querying system
tables may have on your cluster.
## Partition-related queries
Use the following queries to return information about partitions in your
{{< product-name omit=" Clustered" >}} cluster.
- [View partition templates of all tables](#view-partition-templates-of-all-tables)
- [View the partition template of a specific table](#view-the-partition-template-of-a-specific-table)
- [View all partitions for a table](#view-all-partitions-for-a-table)
- [View the number of partitions per table](#view-the-number-of-partitions-per-table)
- [View the number of partitions for a specific table](#view-the-number-of-partitions-for-a-specific-table)
---
In the examples below, replace {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}
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 %}}
### View the partition template of a specific table
```sql
SELECT * FROM system.tables WHERE table_name = 'TABLE_NAME'
```
#### Example results
| table_name | partition_template |
| :--------- | :----------------------------------------------------------------------------------------- |
| weather | `{"parts":[{"timeFormat":"%Y-%m-%d"},{"bucket":{"tagName":"location","numBuckets":250}}]}` |
### View all partitions for a table
```sql
SELECT * FROM system.partitions WHERE table_name = 'TABLE_NAME'
```
### Example results
| partition_id | table_name | partition_key | last_new_file_created_at | num_files | total_size_mb |
| -----------: | :--------- | :---------------- | -----------------------: | --------: | ------------: |
| 1362 | weather | 43 \| 2020-05-27 | 1683747418763813713 | 1 | 0 |
| 800 | weather | 234 \| 2021-08-02 | 1683747421899400796 | 1 | 0 |
| 630 | weather | 325 \| 2022-03-17 | 1683747417616689036 | 1 | 0 |
| 1401 | weather | 12 \| 2021-01-09 | 1683747417786122295 | 1 | 0 |
| 1012 | weather | 115 \| 2022-07-04 | 1683747417614219148 | 1 | 0 |
### View the number of partitions per table
```sql
SELECT
table_name,
COUNT(*) AS partition_count
FROM
system.partitions
GROUP BY
table_name
```
### Example results
| table_name | partition_count |
| :--------- | --------------: |
| weather | 1096 |
| home | 24 |
| numbers | 1 |
### View the number of partitions for a specific table
```sql
SELECT
COUNT(*) AS partition_count
FROM
system.partitions
WHERE
table_name = 'TABLE_NAME'
```
### Example results
| table_name | partition_count |
| :--------- | --------------: |
| weather | 1096 |
{{% /code-placeholders %}}

View File

@ -230,9 +230,9 @@ Use the `--template-tag`, `--template-tag-bucket, and `--template-timeformat`
flags to define partition template parts used to generate partition keys for the database.
For more information, see [Manage data partitioning](/influxdb/clustered/admin/custom-partitions/).
{{% note %}}
{{% warn %}}
#### Partition templates can only be applied on create
You can only apply a partition template when creating a database.
You can't update a partition template on an existing database.
{{% /note %}}
{{% /warn %}}

View File

@ -71,9 +71,9 @@ If no template flags are provided, the table uses the partition template of the
target database.
For more information, see [Manage data partitioning](/influxdb/clustered/admin/custom-partitions/).
{{% note %}}
{{% warn %}}
#### Partition templates can only be applied on create
You can only apply a partition template when creating a table.
There is no way to update a partition template on an existing table.
{{% /note %}}
{{% /warn %}}

View File

@ -145,10 +145,60 @@ When pulling InfluxDB Clustered images, there are two main scenarios:
- You run in an environment with no network interfaces ("air-gapped") and you
can only access a private container registry.
In both scenarios, you need a valid container registry secret file.
Use [crane](https://github.com/google/go-containerregistry/tree/main/cmd/crane) to create a container registry secret file.
In both scenarios, you need a valid _pull secret_.
1. [Install crane](https://github.com/google/go-containerregistry/tree/main/cmd/crane#installation)
{{< tabs-wrapper >}}
{{% tabs %}}
[Public registry (non-air-gapped)](#)
[Private registry (air-gapped)](#)
{{% /tabs %}}
{{% tab-content %}}
<!--------------------------- BEGIN Public Registry --------------------------->
#### Public registry (non-air-gapped)
To pull from the InfluxData registry, you need to create a Kubernetes secret in the target namespace.
```sh
kubectl create secret docker-registry gar-docker-secret \
--from-file=.dockerconfigjson=influxdb-docker-config.json \
--namespace influxdb
```
If successful, the output is the following:
```text
secret/gar-docker-secret created
```
By default, this secret is named `gar-docker-secret`.
If you change the name of this secret, you must also change the value of the
`imagePullSecret` field in the `AppInstance` custom resource to match.
<!---------------------------- END Public Registry ---------------------------->
{{% /tab-content %}}
{{% tab-content %}}
<!--------------------------- BEGIN Private Registry -------------------------->
#### Private registry (air-gapped)
If your Kubernetes cluster can't use a public network to download container images
from our container registry, do the following:
1. Copy the images from the InfluxDB registry to your own private registry.
2. Configure your `AppInstance` resource with a reference to your private
registry name.
3. Provide credentials to your private registry.
##### Copy the images
We recommend using [crane](https://github.com/google/go-containerregistry/tree/main/cmd/crane) to copy images into your private registry.
1. [Install crane](https://github.com/google/go-containerregistry/tree/main/cmd/crane#installation) for your system.
2. Use the following command to create a container registry secret file and
retrieve the necessary secrets:
@ -212,55 +262,8 @@ If theres a problem with the Docker configuration, crane won't retrieve the m
Error: fetching manifest us-docker.pkg.dev/influxdb2-artifacts/clustered/influxdb:<package-version>: GET https://us-docker.pkg.dev/v2/token?scope=repository%3Ainfluxdb2-artifacts%2Fclustered%2Finfluxdb%3Apull&service=: DENIED: Permission "artifactregistry.repositories.downloadArtifacts" denied on resource "projects/influxdb2-artifacts/locations/us/repositories/clustered" (or it may not exist)
```
{{< tabs-wrapper >}}
{{% tabs %}}
[Public registry (non-air-gapped)](#)
[Private registry (air-gapped)](#)
{{% /tabs %}}
{{% tab-content %}}
<!--------------------------- BEGIN Public Registry --------------------------->
#### Public registry (non-air-gapped)
To pull from the InfluxData registry, you need to create a Kubernetes secret in the target namespace.
```sh
kubectl create secret docker-registry gar-docker-secret \
--from-file=.dockerconfigjson=influxdb-docker-config.json \
--namespace influxdb
```
If successful, the output is the following:
```text
secret/gar-docker-secret created
```
By default, this secret is named `gar-docker-secret`.
If you change the name of this secret, you must also change the value of the
`imagePullSecret` field in the `AppInstance` custom resource to match.
<!---------------------------- END Public Registry ---------------------------->
{{% /tab-content %}}
{{% tab-content %}}
<!--------------------------- BEGIN Private Registry -------------------------->
#### Private registry (air-gapped)
If your Kubernetes cluster can't use a public network to download container images
from our container registry, do the following:
1. Copy the images from the InfluxDB registry to your own private registry.
2. Configure your `AppInstance` resource with a reference to your private
registry name.
3. Provide credentials to your private registry.
The list of images that you need to copy is included in the package metadata.
You can obtain it with any standard OCI image inspection tool. For example:
You can obtain it with any standard OCI image inspection tool--for example:
{{% code-placeholders "PACKAGE_VERSION" %}}
@ -307,6 +310,8 @@ myregistry.mydomain.io
---
##### Configure your AppInstance
Set the
`.spec.package.spec.images.registryOverride` field in `myinfluxdb.yml` to the location of your private registry--for example:
@ -325,6 +330,25 @@ spec:
{{% /code-placeholders %}}
##### Provide credentials to your private registry
If your private container registry requires pull secrets to access images, you can create the required kubernetes secrets, and then configure them in your AppInstance resource.
{{% code-placeholders "PULL_SECRET_NAME" %}}
```yml
apiVersion: kubecfg.dev/v1alpha1
kind: AppInstance
# ...
spec:
imagePullSecrets:
- name: PULL_SECRET_NAME
```
{{% /code-placeholders %}}
<!---------------------------- END Private Registry --------------------------->
{{% /tab-content %}}

View File

@ -32,6 +32,7 @@ influxctl [flags] [command]
| Command | Description |
| :-------------------------------------------------------------------- | :------------------------------------- |
| [auth](/influxdb/clustered/reference/cli/influxctl/auth/) | Log in to or log out of InfluxDB v3 |
| [cluster](/influxdb/clustered/reference/cli/influxctl/cluster/) | List InfluxDB v3 cluster information |
| [database](/influxdb/clustered/reference/cli/influxctl/database/) | Manage InfluxDB v3 databases |
| [help](/influxdb/clustered/reference/cli/influxctl/help/) | Output `influxctl` help information |

View File

@ -0,0 +1,32 @@
---
title: influxctl auth
description: >
The `influxctl auth` command and its subcommands let a user
log in to and log out of an InfluxDB cluster.
menu:
influxdb_clustered:
parent: influxctl
weight: 201
---
The `influxctl auth` command and its subcommands let a user log in to and log out of an {{< product-name omit="Clustered" >}} cluster.
## Usage
```sh
influxctl auth [subcommand] [subcommand options] [arguments...]
```
## Subcommands
| Subcommand | Description |
| :----------------------------------------------------------------- | :------------------------------ |
| [login](/influxdb/clustered/reference/cli/influxctl/auth/login/) | Log in to an InfluxDB cluster using the cluster's identity provider |
| [logout](/influxdb/clustered/reference/cli/influxctl/auth/logout/) | Remove local tokens |
| help, h | Output command help |
## Flags
| Flag | | Description |
| :--- | :------- | :------------------ |
| `-h` | `--help` | Output command help |

View File

@ -0,0 +1,29 @@
---
title: influxctl auth login
description: >
The `influxctl auth login` command lets a user log in to an InfluxDB cluster
using the cluster's configured identity provider.
menu:
influxdb_clustered:
parent: influxctl auth
weight: 301
---
The `influxctl auth login` command lets a user log in to an {{< product-name omit="Clustered" >}}
cluster using the cluster's configured identity provider.
## Usage
```sh
influxctl auth login
```
## Flags
| Flag | | Description |
| :--- | :--------- | :-------------------------------------------- |
| `-h` | `--help` | Output command help |
{{% caption %}}
_Also see [`influxctl` global flags](/influxdb/clustered/reference/cli/influxctl/#global-flags)._
{{% /caption %}}

View File

@ -0,0 +1,29 @@
---
title: influxctl auth logout
description: >
The `influxctl auth logout` command lets a user log out of an InfluxDB
cluster and removes the user's local authorization tokens.
menu:
influxdb_clustered:
parent: influxctl auth
weight: 301
---
The `influxctl auth logout` command lets a user log out of an {{< product-name omit="Clustered" >}}
cluster and removes the user's local authorization tokens.
## Usage
```sh
influxctl auth logout
```
## Flags
| Flag | | Description |
| :--- | :--------- | :-------------------------------------------- |
| `-h` | `--help` | Output command help |
{{% caption %}}
_Also see [`influxctl` global flags](/influxdb/clustered/reference/cli/influxctl/#global-flags)._
{{% /caption %}}

View File

@ -155,8 +155,8 @@ influxctl database create \
### Create a database with a custom partition template
The following example creates a new `mydb` database and applies a partition
template that partitions by two tags (`room` and `sensor-type`) and by week using
the time format `%Y wk:%W`:
template that partitions by two tags (`room` and `sensor-type`) and by day using
the time format `%Y-%m-%d`:
<!--Skip tests for database create and delete: namespaces aren't reusable-->
<!--pytest.mark.skip-->
@ -166,7 +166,7 @@ influxctl database create \
--template-tag room \
--template-tag sensor-type \
--template-tag-bucket customerID,1000 \
--template-timeformat '%Y wk:%W' \
--template-timeformat '%Y-%m-%d' \
mydb
```

View File

@ -82,8 +82,8 @@ influxctl table create DATABASE_NAME TABLE_NAME
### Create a table with a custom partition template
The following example creates a new table and applies a partition
template that partitions by two tags (`room` and `sensor-type`) and by week using
the time format `%Y wk:%W`:
template that partitions by two tags (`room` and `sensor-type`) and by day using
the time format `%Y-%m-%d`:
{{% code-placeholders "(DATABASE|TABLE)_NAME" %}}
```sh
@ -91,7 +91,7 @@ influxctl table create \
--template-tag room \
--template-tag sensor-type \
--template-tag-bucket customerID,1000 \
--template-timeformat '%Y wk:%W' \
--template-timeformat '%Y-%m-%d' \
DATABASE_NAME \
TABLE_NAME
```

View File

@ -12,6 +12,25 @@ weight: 202
canonical: /influxdb/cloud-dedicated/reference/release-notes/influxctl/
---
## v2.9.6 {date="2024-08-15"}
### Bug Fixes
- Update query subcommand to wait for EOF on stdin instead of the first newline.
## v2.9.5 {date="2024-08-13"}
### Bug Fixes
- Introduce auth login and logout commands.
- Attempt to refresh OAuth tokens when refresh token is present.
### Dependency Updates
- Update `github.com/urfave/cli/v2` from 2.27.2 to 2.27.4
- Update `golang.org/x/mod` from 0.19.0 to 0.20.0
- Update `golang.org/x/oauth2` from 0.21.0 to 0.22.0
## v2.9.4 {date="2024-07-25"}
### Bug Fixes

View File

@ -55,7 +55,7 @@ influxdb_cloud_dedicated:
list_order: 3
latest: cloud-dedicated
link: "https://www.influxdata.com/contact-sales-form/"
latest_cli: 2.9.4
latest_cli: 2.9.6
placeholder_host: cluster-id.a.influxdb.io
influxdb_clustered:

View File

@ -534,9 +534,9 @@ eastasianwidth@^0.2.0:
integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==
electron-to-chromium@^1.5.4:
version "1.5.12"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.12.tgz#ee31756eaa2e06f2aa606f170b7ad06dd402b4e4"
integrity sha512-tIhPkdlEoCL1Y+PToq3zRNehUaKp3wBX/sr7aclAWdIWjvqAe/Im/H0SiCM4c1Q8BLPHCdoJTol+ZblflydehA==
version "1.5.13"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.13.tgz#1abf0410c5344b2b829b7247e031f02810d442e6"
integrity sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==
emoji-regex@^8.0.0:
version "8.0.0"
@ -831,9 +831,9 @@ http2-wrapper@^2.1.10:
resolve-alpn "^1.2.0"
hugo-extended@>=0.101.0:
version "0.132.2"
resolved "https://registry.yarnpkg.com/hugo-extended/-/hugo-extended-0.132.2.tgz#cca3d82d7ffd6145d535a787d3963215c8af075b"
integrity sha512-KsEeBOratmFHaX8RnJSnkrqy4HaYn+GctHJRtUtoZJZ/mE1knogBKeB4Ss6T3juBwBS9PVF7hb9XSkjeJUAo2Q==
version "0.133.0"
resolved "https://registry.yarnpkg.com/hugo-extended/-/hugo-extended-0.133.0.tgz#77ad49e1e394634337b7ce198053e670969fe836"
integrity sha512-+C3I/0uUww04mcdkRdcdsfqHlCXMRQrvi7dUqlyPQViDqIMszPzKQorKEB3YddYEJLomLKoUtAoxs2JVqTXT8A==
dependencies:
careful-downloader "^3.0.0"
log-symbols "^5.1.0"
@ -875,9 +875,9 @@ is-binary-path@~2.1.0:
binary-extensions "^2.0.0"
is-core-module@^2.5.0:
version "2.15.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.15.0.tgz#71c72ec5442ace7e76b306e9d48db361f22699ea"
integrity sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==
version "2.15.1"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.15.1.tgz#a7363a25bee942fefab0de13bf6aa372c82dcc37"
integrity sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==
dependencies:
hasown "^2.0.2"