Skip to content

Commit

Permalink
Add note about new interface availability (#2883)
Browse files Browse the repository at this point in the history
* Add note about new interface availability

Add note about dimension info constructors only available in 2.13 and
later to all places where the new interface is used.

* Update api/create_hypertable.md

Co-authored-by: Yannis Roussos <[email protected]>
Signed-off-by: Mats Kindahl <[email protected]>

* Add proper highlight tags and make wording consistent

* Parser does not deal with markdown hyperlinks, it seems.

* Document generation is case sensitive

The tag `highlight` have to be spelled `Highlight` to work.

---------

Signed-off-by: Mats Kindahl <[email protected]>
Co-authored-by: Yannis Roussos <[email protected]>
  • Loading branch information
mkindahl and iroussos authored Dec 12, 2023
1 parent 8b2f724 commit ae743c7
Show file tree
Hide file tree
Showing 28 changed files with 117 additions and 17 deletions.
4 changes: 4 additions & 0 deletions _partials/_create-hypertable-blockchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ with Timescale tables similar to standard PostgreSQL.
SELECT create_hypertable('transactions', by_range('time'));
```

<Highlight type="note">
The `by_range` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>

1. Create an index on the `hash` column to make queries for individual
transactions faster:

Expand Down
4 changes: 4 additions & 0 deletions _partials/_create-hypertable-energy.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@ with Timescale tables similar to standard PostgreSQL.
SELECT create_hypertable('metrics', by_range('created'));
```

<Highlight type="note">
The `by_range` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>

</Procedure>

4 changes: 4 additions & 0 deletions _partials/_create-hypertable-nyctaxis.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ with Timescale tables similar to standard PostgreSQL.
SELECT add_dimension('rides', by_hash('payment_type', 2));
```

<Highlight type="note">
The `by_range` and `by_hash` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>

1. Create an index to support efficient queries by vendor, rate code, and
passenger count:

Expand Down
4 changes: 4 additions & 0 deletions _partials/_create-hypertable-twelvedata-crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ with Timescale tables similar to standard PostgreSQL.
SELECT create_hypertable('crypto_ticks', by_range('time'));
```

<Highlight type="note">
The `by_range` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>

</Procedure>

## Create standard PostgreSQL tables for relational data
Expand Down
4 changes: 2 additions & 2 deletions api/_hyperfunctions/time_bucket_gapfill/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ Aggregate data by time interval, while filling in gaps of missing data.
gapfilling capabilities. The other functions in this group must be used in the
same query as `time_bucket_gapfill`. They control how missing values are treated.

<highlight type="important">
<Highlight type="important">
`time_bucket_gapfill` must be used as a top-level expression in a query or
subquery. You cannot, for example, nest `time_bucket_gapfill` in another
function (such as `round(time_bucket_gapfill(...))`), or cast the result of the
gapfilling call. If you need to cast, you can use `time_bucket_gapfill` in a
subquery, and let the outer query do the type cast.
</highlight>
</Highlight>

[time_bucket]: /api/latest/hyperfunctions/time_bucket/
7 changes: 5 additions & 2 deletions api/add_dimension.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ api:

# add_dimension()

<Highlight type="note">
This reference describes the new generalized hypertable API introduced with 2.13.
The [old interface for `add_dimension` is also available](add_dimension_old.md).
</Highlight>

Add an additional partitioning dimension to a Timescale hypertable.
The column selected as the dimension can either use interval
partitioning (for example, for a second range partition) or hash partitioning.

**Note: this reference describes the new generalized hypertable API. The [old interface for `add_dimension` is also available](add_dimension_old.md).**

<Highlight type="warning">
The `add_dimension` command can only be executed after a table has been
converted to a hypertable (via `create_hypertable`), but must similarly
Expand Down
4 changes: 4 additions & 0 deletions api/chunks.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ If the chunk's primary dimension is of a time datatype, `range_start` and

Get information about the chunks of a hypertable.

<Highlight type="note">
Dimension info constructor `by_range` was introduced in TimescaleDB 2.13.
</Highlight>

```sql
CREATE TABLESPACE tablespace1 location '/usr/local/pgsql/data1';

Expand Down
5 changes: 5 additions & 0 deletions api/compression_settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,8 @@ orderby_column_index | 2
orderby_asc | t
orderby_nullsfirst | f
```

<Highlight type="note">
The `by_range` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>

4 changes: 3 additions & 1 deletion api/create_distributed_hypertable.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ Creates a TimescaleDB hypertable distributed across a multinode
environment. Use this function in place of [`create_hypertable`][create-hypertable-old]
when creating distributed hypertables.

**Note that distributed tables use the old API. The new generalized API is described in [`create_hypertable`][create-hypertable-new].**
<Highlight type="note">
Distributed tables use the old API. The new generalized API introduced in 2.13 is described in [`create_hypertable`][create-hypertable-new].
</Highlight>

### Required arguments

Expand Down
5 changes: 4 additions & 1 deletion api/create_hypertable.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ on the resulting hypertable.
For more information about using hypertables, including chunk size partitioning,
see the [hypertable section][hypertable-docs].

**Note: this reference describes the new generalized hypertable API. The [old interface for `create_hypertable is also available][create-hypertable-old].**
<Highlight type="note">
This reference describes the new generalized hypertable API that was introduced in TimescaleDB 2.13.
The [old interface for `create_hypertable is also available][create-hypertable-old].
</Highlight>

## Required arguments

Expand Down
8 changes: 6 additions & 2 deletions api/dimension_info.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# Dimension Info Constructurs

<Highlight type="note">
Dimension info constructors were introduced in TimescaleDB 2.13.
</Highlight>

The `create_hypertable` and `add_dimension` are used together with
dimension info constructors to specify the dimensions to partition a
hypertable on.

TimescaleDB currently supports two partition types: partitioning by
range and partitioning by hash.

<highlight type="tip">
<Highlight type="tip">
For incompatible data types (for example, `jsonb`) you can specify a function to
the `time_partitioning_func` argument which can extract a compatible
data type
</highlight>
</Highlight>

## Partition Function

Expand Down
4 changes: 4 additions & 0 deletions api/dimensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ integer_now_func |
num_partitions | 2
```

<Highlight type="note">
The `by_range` and `by_hash` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>

Get information about dimensions of a hypertable that has two time-based dimensions.

``` sql
Expand Down
4 changes: 2 additions & 2 deletions api/hypertable_compression_stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ For more information about compression, see the
|`after_compression_total_bytes`|BIGINT|Size of the entire table (table+indexes+toast) after compression|
|`node_name`|TEXT|nodes on which the hypertable is located, applicable only to distributed hypertables|

<highlight type="note">
<Highlight type="note">
Returns show `NULL` if the data is currently uncompressed.
</highlight>
</Highlight>

### Sample usage

Expand Down
4 changes: 4 additions & 0 deletions api/time_bucket_ng.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ ORDER BY bucket;
(3 rows)
```

<Highlight type="note">
The `by_range` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>

For more information, see the [continuous aggregates documentation][caggs].

<Highlight type="important">
Expand Down
4 changes: 4 additions & 0 deletions migrate/dual-write-and-backfill/dual-write-from-postgres.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ database, execute:
SELECT create_hypertable('<table name>', by_range('<time column name>'));
```

<Highlight type="note">
The `by_range` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>

For more information about the options which you can pass to
`create_hypertable`, consult the [create_table API reference]. For
more information about hypertables in general, consult the
Expand Down
4 changes: 4 additions & 0 deletions mst/ingest-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ and can connect to it using `psql`.
SELECT create_hypertable('conditions', by_range('time'));
```

<Highlight type="note">
The `by_range` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>

</Procedure>

When you have successfully set up your new database, you can ingest data using
Expand Down
4 changes: 4 additions & 0 deletions quick-start/golang.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ and most other tasks are executed on the hypertable.
queryCreateHypertable := `SELECT create_hypertable('sensor_data', by_range('time'));`
```
<Highlight type="note">
The `by_range` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>
1. Execute the `CREATE TABLE` statement and `SELECT` statement which converts
the table into a hypertable. You can do this by calling the `Exec()`
function on the `dbpool` object, using the arguments of the current context,
Expand Down
14 changes: 9 additions & 5 deletions quick-start/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ are ready to connect to TimescaleDB from Java.
For more information about creating connection strings, see the [JDBC documentation][pg-jdbc-driver-conn-docs].
<highlight type="warning">
<Highlight type="warning">
This method of composing a connection string is for test or development
purposes only. For production, use environment variables for sensitive
details like your password, hostname, and port number.
</highlight>
</Highlight>
```java
package com.timescale.java;
Expand Down Expand Up @@ -238,9 +238,13 @@ and most other tasks are executed on the hypertable.
1. Create a statement, execute the query you created in the previous step:
```sql
SELECT create_hypertable('sensor_data', by_range('time'));
```
```sql
SELECT create_hypertable('sensor_data', by_range('time'));
```
<Highlight type="note">
The `by_range` and `by_hash` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>
1. Execute the two statements you created, and commit your changes to the
database:
Expand Down
4 changes: 4 additions & 0 deletions quick-start/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ and most other tasks are executed on the hypertable.
};
```
<Highlight type="note">
The `by_range` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>
1. At the command prompt, run the migration command:
```bash
Expand Down
4 changes: 4 additions & 0 deletions quick-start/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ and most other tasks are executed on the hypertable.
query_create_sensordata_hypertable = "SELECT create_hypertable('sensor_data', by_range('time'));"
```

<Highlight type="note">
The `by_range` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>

3. Open a cursor with the connection, execute the statements from the previous
steps, commit your changes, and close the cursor:

Expand Down
4 changes: 4 additions & 0 deletions quick-start/ruby.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ and most other tasks are executed on the hypertable.
end
```
<Highlight type="note">
The `by_range` and `by_hash` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>
1. Generate the hypertable:
```ruby
Expand Down
4 changes: 4 additions & 0 deletions self-hosted/migration/same-db.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ Migrate your data into Timescale from within the same database.
SELECT create_hypertable('new_table', by_range('ts'));
```

<Highlight type="note">
The `by_range` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>

1. Insert data from the old table to the new table.

```sql
Expand Down
4 changes: 4 additions & 0 deletions self-hosted/migration/schema-then-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ restore them.

</Procedure>

<Highlight type="note">
The `by_range` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>

## Copy data from the source database

After restoring your hypertables, return to your source database to copy your
Expand Down
4 changes: 4 additions & 0 deletions use-timescale/hyperfunctions/counter-aggs.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ out of it.
SELECT create_hypertable('example', by_range('ts', '15 days'::interval), migrate_data => true);
```

<Highlight type="note">
The `by_range` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>

1. Create the continuous aggregate:

```sql
Expand Down
7 changes: 5 additions & 2 deletions use-timescale/hypertables/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ keywords: [hypertables, create]

# Create hypertables

**Note: this uses the new generalized hypertable API. The [old interface for `create_hypertable is also available](create_hypertable_old.md).**

<Highlight type="note">
This code uses the new generalized hypertable API introduced in
TimescaleDB 2.13. The [old interface for `create_hypertable is also
available](create_hypertable_old.md).
</Highlight>

After [creating a Timescale database][install], you're ready to create your
first hypertable. Creating a hypertable is a two-step process:
Expand Down
4 changes: 4 additions & 0 deletions use-timescale/integrations/data-ingest/telegraf.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ Before you start, make sure you have:
```

<Highlight type="note">
The `by_range` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>

</Procedure>

<Procedure>
Expand Down
4 changes: 4 additions & 0 deletions use-timescale/schema-management/about-constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ CREATE TABLE conditions (
SELECT create_hypertable('conditions', by_range('time'));
```

<Highlight type="note">
The `by_range` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>

This example also references values in another `locations` table using a foreign
key constraint.

Expand Down
4 changes: 4 additions & 0 deletions use-timescale/schema-management/indexing.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ SELECT create_hypertable('conditions', by_range('time'))
CREATE_DEFAULT_INDEXES false;
```

<Highlight type="note">
The `by_range` dimension info constructor is an addition to TimescaleDB 2.13.
</Highlight>

## Best practices for indexing

If you have sparse data, with columns that are often NULL, you can add a clause
Expand Down

0 comments on commit ae743c7

Please sign in to comment.