|
3 | 3 |
|
4 | 4 | 1. **Connect to your $SERVICE_LONG**
|
5 | 5 |
|
6 |
| - In [$CONSOLE][services-portal] open an [SQL editor][in-console-editors]. You can also connect to your service using [psql][connect-using-psql]. |
| 6 | + In [$CONSOLE][services-portal] open an [SQL editor][in-console-editors]. You can also connect to your $SERVICE_SHORT using [psql][connect-using-psql]. |
7 | 7 |
|
8 |
| -1. **Enable columnstore on a hypertable** |
| 8 | +1. **Enable $COLUMNSTORE on a $HYPERTABLE** |
9 | 9 |
|
10 |
| - Create a [job][job] that automatically moves chunks in a hypertable to the columnstore at a specific time interval. |
11 |
| - By default, your table is `orderedby` the time column. For efficient queries on columnstore data, remember to |
| 10 | + By default, your table is `orderedby` the time column. For efficient queries on $COLUMNSTORE data, remember to |
12 | 11 | `segmentby` the column you will use most often to filter your data:
|
13 | 12 |
|
14 |
| - * [Use `ALTER TABLE` for a hypertable][alter_table_hypercore] |
| 13 | + * [Use `ALTER TABLE` for a $HYPERTABLE][alter_table_hypercore] |
15 | 14 | ```sql
|
16 | 15 | ALTER TABLE crypto_ticks SET (
|
17 | 16 | timescaledb.enable_columnstore = true,
|
18 | 17 | timescaledb.segmentby = 'symbol');
|
19 | 18 | ```
|
20 |
| - * [Use ALTER MATERIALIZED VIEW for a continuous aggregate][compression_continuous-aggregate] |
| 19 | + * [Use ALTER MATERIALIZED VIEW for a $CAGG][compression_continuous-aggregate] |
21 | 20 | ```sql
|
22 | 21 | ALTER MATERIALIZED VIEW assets_candlestick_daily set (
|
23 | 22 | timescaledb.enable_columnstore = true,
|
24 | 23 | timescaledb.segmentby = 'symbol' );
|
25 | 24 | ```
|
26 |
| - Before you say `huh`, a continuous aggregate is a specialized hypertable. |
| 25 | + Before you say `huh`, a $CAGG is a specialized $HYPERTABLE. |
27 | 26 |
|
28 |
| -1. **Add a policy to convert chunks to the columnstore at a specific time interval** |
| 27 | +1. **Add a policy to convert $CHUNKs to the $COLUMNSTORE at a specific time interval** |
29 | 28 |
|
30 |
| - For example, move yesterday's crypto trading data to the columnstore: |
| 29 | + Create a [$JOB][job] that automatically converts $CHUNKs in a $HYPERTABLE to the $COLUMNSTORE at a specific time interval. For example, convert yesterday's crypto trading data to the $COLUMNSTORE: |
31 | 30 | ``` sql
|
32 | 31 | CALL add_columnstore_policy('crypto_ticks', after => INTERVAL '1d');
|
33 | 32 | ```
|
34 | 33 | See [add_columnstore_policy][add_columnstore_policy].
|
35 | 34 |
|
36 |
| -1. **Check the columstore policy** |
| 35 | +1. **Check the $COLUMNSTORE policy** |
37 | 36 |
|
38 | 37 | 1. View your data space saving:
|
39 | 38 |
|
40 |
| - When you convert data to the columnstore, as well as being optimized for analytics, it is compressed by more than |
41 |
| - 90%. This saves on storage costs and keeps your queries operating at lightning speed. To see the amount of space |
| 39 | + When you convert data to the $COLUMNSTORE, as well as being optimized for analytics, it is compressed by more than |
| 40 | + 90%. This helps you save on storage costs and keeps your queries operating at lightning speed. To see the amount of space |
42 | 41 | saved:
|
43 | 42 |
|
44 | 43 | ``` sql
|
|
61 | 60 | ```
|
62 | 61 | See [timescaledb_information.jobs][informational-views].
|
63 | 62 |
|
64 |
| -1. **Pause a columnstore policy** |
| 63 | +1. **Pause a $COLUMNSTORE policy** |
65 | 64 |
|
66 |
| - If you need to modify or add a lot of data to a chunk in the columnstore, best practice is to stop any jobs moving |
67 |
| - chunks to the columnstore, [convert the chunk back to the rowstore][convert_to_rowstore], then modify the data. |
68 |
| - After the update, [convert the chunk to the columnstore][convert_to_columnstore] and restart the jobs. |
| 65 | + If you need to modify or add a lot of data to a $CHUNK in the $COLUMNSTORE, best practice is to stop any jobs moving |
| 66 | + $CHUNKs to the $COLUMNSTORE, [convert the $CHUNK back to the $ROWSTORE][convert_to_rowstore], then modify the data. |
| 67 | + After the update, [convert the $CHUNK to the $COLUMNSTORE][convert_to_columnstore] and restart the jobs. |
69 | 68 |
|
70 | 69 | ``` sql
|
71 | 70 | SELECT * FROM timescaledb_information.jobs where
|
|
77 | 76 | ```
|
78 | 77 | See [alter_job][alter_job].
|
79 | 78 |
|
80 |
| -1. **Restart a columnstore policy** |
| 79 | +1. **Restart a $COLUMNSTORE policy** |
81 | 80 |
|
82 | 81 | ``` sql
|
83 | 82 | SELECT alter_job(JOB_ID, scheduled => true);
|
84 | 83 | ```
|
85 | 84 | See [alter_job][alter_job].
|
86 | 85 |
|
87 |
| -1. **Remove a columnstore policy** |
| 86 | +1. **Remove a $COLUMNSTORE policy** |
88 | 87 |
|
89 | 88 | ``` sql
|
90 | 89 | CALL remove_columnstore_policy('crypto_ticks');
|
91 | 90 | ```
|
92 | 91 | See [remove_columnstore_policy][remove_columnstore_policy].
|
93 | 92 |
|
94 |
| -1. **Disable columnstore** |
| 93 | +1. **Disable $COLUMNSTORE** |
95 | 94 |
|
96 |
| - If your table has chunks in the columnstore, you have to |
97 |
| - [convert the chunks back to the rowstore][convert_to_rowstore] before you disable the columnstore. |
| 95 | + If your table has $CHUNKs in the $COLUMNSTORE, you have to |
| 96 | + [convert the $CHUNKs back to the $ROWSTORE][convert_to_rowstore] before you disable the $COLUMNSTORE. |
98 | 97 | ``` sql
|
99 | 98 | ALTER TABLE crypto_ticks SET (timescaledb.enable_columnstore = false);
|
100 | 99 | ```
|
|
0 commit comments