-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hypercore add indexing to optimize and modify pages (#3773)
* chore: include indexing in optimize and modify docs.
- Loading branch information
1 parent
f8241c1
commit 15219b9
Showing
19 changed files
with
412 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import EarlyAccess from "versionContent/_partials/_early_access.mdx"; | ||
|
||
## Policies | ||
|
||
### `timescaledb.max_background_workers (int)` | ||
|
||
Max background worker processes allocated to TimescaleDB. Set to at least 1 + | ||
the number of databases loaded with a TimescaleDB extension in a PostgreSQL | ||
instance. Default value is 16. | ||
|
||
### `timescaledb.enable_tiered_reads (bool)` | ||
|
||
Enable [tiered reads][enabling-data-tiering] to that you query your data normally when it's distributed across different storage tiers. | ||
Your hypertable is spread across the tiers, so queries and `JOIN`s work and fetch the same data as usual. | ||
|
||
By default, tiered data is not accessed by queries. Querying tiered data may slow down query performance | ||
as the data is not stored locally on Timescale's high-performance storage tier. | ||
|
||
## Hypercore features | ||
|
||
### `timescaledb.default_hypercore_use_access_method (bool)` | ||
|
||
The default value for `hypercore_use_access_method` for functions that have this parameter. This function is in `user` context, meaning that any user can set it for the session. The default value is `false`. | ||
|
||
<EarlyAccess /> | ||
|
||
## $SERVICE_LONG tuning | ||
|
||
### `timescaledb.disable_load (bool)` | ||
|
||
Disable the loading of the actual extension | ||
|
||
### `timescaledb.enable_cagg_reorder_groupby (bool)` | ||
Enable group by reordering | ||
|
||
### `timescaledb.enable_chunk_append (bool)` | ||
Enable chunk append node | ||
|
||
### `timescaledb.enable_constraint_aware_append (bool)` | ||
Enable constraint-aware append scans | ||
|
||
### `timescaledb.enable_constraint_exclusion (bool)` | ||
Enable constraint exclusion | ||
|
||
### `timescaledb.enable_job_execution_logging (bool)` | ||
Enable job execution logging | ||
|
||
### `timescaledb.enable_optimizations (bool)` | ||
Enable TimescaleDB query optimizations | ||
|
||
### `timescaledb.enable_ordered_append (bool)` | ||
Enable ordered append scans | ||
|
||
### `timescaledb.enable_parallel_chunk_append (bool)` | ||
Enable parallel chunk append node | ||
|
||
### `timescaledb.enable_runtime_exclusion (bool)` | ||
Enable runtime chunk exclusion | ||
|
||
### `timescaledb.enable_tiered_reads (bool)` | ||
|
||
Enable [tiered reads][enabling-data-tiering] to that you query your data normally when it's distributed across different storage tiers. | ||
Your hypertable is spread across the tiers, so queries and `JOIN`s work and fetch the same data as usual. | ||
|
||
By default, tiered data is not accessed by queries. Querying tiered data may slow down query performance | ||
as the data is not stored locally on Timescale's high-performance storage tier. | ||
|
||
|
||
### `timescaledb.enable_transparent_decompression (bool)` | ||
Enable transparent decompression | ||
|
||
|
||
### `timescaledb.restoring (bool)` | ||
Stop any background workers which could have been performing tasks. This is especially useful you | ||
migrate data to your [$SERVICE_LONG][pg-dump-and-restore] or [self-hosted database][migrate-entire]. | ||
|
||
### `timescaledb.max_cached_chunks_per_hypertable (int)` | ||
Maximum cached chunks | ||
|
||
### `timescaledb.max_open_chunks_per_insert (int)` | ||
Maximum open chunks per insert | ||
|
||
### `timescaledb.max_tuples_decompressed_per_dml_transaction (int)` | ||
|
||
The max number of tuples that can be decompressed during an INSERT, UPDATE, or DELETE. | ||
|
||
[enabling-data-tiering]: /use-timescale/:currentVersion:/data-tiering/enabling-data-tiering/ | ||
[pg-dump-and-restore]: /migrate/:currentVersion:/pg-dump-and-restore/ | ||
[migrate-entire]: /self-hosted/:currentVersion:/migration/entire-database/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
<Highlight type="important"> | ||
This feature is early access. Early access features might be subject to billing | ||
changes in the future. If you have feedback, reach out to your customer success | ||
manager, or [contact us](https://www.timescale.com/contact/). | ||
</Highlight> | ||
<Tag variant="hollow">Early access: TimescaleDB v2.18.0</Tag> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
--- | ||
api_name: ALTER MATERIALIZED VIEW (Hypercore) | ||
excerpt: Change an existing continuous aggregate | ||
topics: [hypercore, continuous aggregates, columnstore,] | ||
keywords: [hypercore, continuous aggregates, columnstore, ] | ||
tags: [materialized views, hypertables, alter, change] | ||
api: | ||
license: community | ||
type: command | ||
--- | ||
|
||
import Since2180 from "versionContent/_partials/_since_2_18_0.mdx"; | ||
import EarlyAccess from "versionContent/_partials/_early_access.mdx"; | ||
|
||
# ALTER MATERIALIZED VIEW (Hypercore) <Tag type="community">Community</Tag> | ||
|
||
`ALTER MATERIALIZED VIEW` statement can be used to modify some of the `WITH` | ||
clause [options][create_materialized_view] for the continuous aggregate view. | ||
`ALTER MATERIALIZED VIEW` statement also supports the following | ||
[PostgreSQL clauses][postgres-alterview] on the | ||
continuous aggregate view: | ||
|
||
* `RENAME TO` clause to rename the continuous aggregate view | ||
* `RENAME [COLUMN]` clause to rename the continuous aggregate column | ||
* `SET SCHEMA` clause to set the new schema for the continuous aggregate view | ||
* `SET TABLESPACE` clause to move the materialization of the continuous | ||
aggregate view to the new tablespace | ||
* `OWNER TO` clause to set new owner for the continuous aggregate view | ||
|
||
<Since2180 /> | ||
|
||
## Samples | ||
|
||
- Disable real-time aggregates for a continuous aggregate: | ||
|
||
```sql | ||
ALTER MATERIALIZED VIEW contagg_view SET (timescaledb.materialized_only); | ||
``` | ||
|
||
- Enable hypercore for a continuous aggregate: | ||
|
||
```sql | ||
ALTER MATERIALIZED VIEW stock_candlestick_daily set (timescaledb.enable_columnstore = true, timescaledb.segmentby = 'symbol' ); | ||
``` | ||
|
||
- Rename a column for a continuous aggregate: | ||
|
||
```sql | ||
ALTER MATERIALIZED VIEW contagg_view RENAME COLUMN old_name TO new_name; | ||
``` | ||
|
||
- **Enable indexing on data in the columnstore** <EarlyAccess /> | ||
|
||
```sql | ||
ALTER MATERIALIZED VIEW stock_candlestick_daily | ||
set access method hypercore, | ||
set (timescaledb.enable_columnstore = true, timescaledb.segmentby = 'symbol' ); | ||
``` | ||
|
||
- **Enable indexing on a chunk you are adding to the columnstore** <EarlyAccess /> | ||
|
||
```sql | ||
ALTER MATERIALIZED VIEW _timescaledb_internal._hyper_1_21_chunk | ||
set access method hypercore; | ||
``` | ||
|
||
The only options that currently can be modified with `ALTER | ||
MATERIALIZED VIEW` are `materialized_only` and `compress`. The other options | ||
`continuous` and `create_group_indexes` can only be set when creating | ||
the continuous aggregate. | ||
|
||
|
||
## Arguments | ||
|
||
The syntax is: | ||
|
||
|
||
``` sql | ||
ALTER MATERIALIZED VIEW <view_name> SET (timescaledb.enable_columnstore, | ||
timescaledb.materialized_only = 'true' | 'false', | ||
timescaledb.orderby = '<column_name> [ASC | DESC] [ NULLS { FIRST | LAST } ] [, ...]', | ||
timescaledb.segmentby = '<column_name> [, ...]', | ||
timescaledb.compress_chunk_time_interval='interval', | ||
SET ACCESS METHOD { new_access_method | DEFAULT } | ||
); | ||
``` | ||
|
||
| Name | Type | Default | Required | Description | | ||
|------------------------------------------------|--|------------------------------------------------------|--|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| `view_name` |TEXT| - | β | The materialized view to enable columstore for. | | ||
| `timescaledb.enable_columnstore` |BOOLEAN| `true` | β | Enable columnstore. | | ||
|`timescaledb.materialized_only`|BOOLEAN| `true` | β | Enable and disable real time aggregation | | ||
| `timescaledb.orderby` |TEXT| Descending order on the time column in `table_name`. | β| The order in which items are used in the columnstore. Specified in the same way as an `ORDER BY` clause in a `SELECT` query. | | ||
| `timescaledb.segmentby` |TEXT| No segementation by column. | β| Set the list of columns used to segment data in the columnstore for `table`. An identifier representing the source of the data such as `device_id` or `tags_id` is usually a good candidate. | | ||
| `column_name` |TEXT| - | β | The name of the column to `orderby` or `segmentby`. | | ||
| `timescaledb.compress_chunk_time_interval` |TEXT| - | β | EXPERIMENTAL: reduce the total number of chunks in the columnstore for `table`. If you set `compress_chunk_time_interval`, chunks added to the columnstore are merged with the previous adjacent chunk within `chunk_time_interval` whenever possible. These chunks are irreversibly merged. If you call [convert_to_rowstore][convert_to_rowstore], merged chunks are not split up. You can call `compress_chunk_time_interval` independently of other compression settings; `timescaledb.enable_columnstore` is not required. | | ||
|`SET ACCESS METHOD`|TEXT| DEFAULT ([heap][default_table_access_method])| β| To enable indexing on the columstore, set to `hypercore` after you [create a continuous aggregate][create-cagg]. <EarlyAccess /> | | ||
|
||
[create_materialized_view]: /api/:currentVersion:/continuous-aggregates/create_materialized_view/#parameters | ||
[postgres-alterview]: https://www.postgresql.org/docs/current/sql-alterview.html | ||
[create-cagg]: /use-timescale/:currentVersion:/continuous-aggregates/create-a-continuous-aggregate/ | ||
[default_table_access_method]: https://www.postgresql.org/docs/17/runtime-config-client.html#GUC-DEFAULT-TABLE-ACCESS-METHOD |
Oops, something went wrong.