Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/broken_link_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ labels: bug, automated issue, link check
assignees: atovpeko
---

The broken link check failed. Check [the workflow logs](https://github.com/timescale/docs/actions/workflows/daily-link-checker.yml) to identify the failing links.
The broken link check failed. Check [the workflow logs][the-workflow-logs] to identify the failing links.

[the-workflow-logs]: https://github.com/timescale/docs/actions/workflows/daily-link-checker.yml
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ _Use this template for reporting bugs in the docs._

## Contributing to documentation

We welcome documentation contributions! For guidelines, see the [contributing guide](https://github.com/timescale/docs/blob/latest/CONTRIBUTING.md).
We welcome documentation contributions! For guidelines, see the [contributing guide][contributing-guide].

[contributing-guide]: https://github.com/timescale/docs/blob/latest/CONTRIBUTING.md
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/rfc.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ assignees: ''

## Contributing to documentation

We welcome documentation contributions! For guidelines, see the [contributing guide](https://github.com/timescale/docs/blob/latest/CONTRIBUTING.md).
We welcome documentation contributions! For guidelines, see the [contributing guide][contributing-guide].

[contributing-guide]: https://github.com/timescale/docs/blob/latest/CONTRIBUTING.md
4 changes: 3 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Fixes #[insert issue link, if any]

# Writing help

For information about style and word usage, see the [Contribution guide](https://github.com/timescale/docs/blob/latest/CONTRIBUTING.md)
For information about style and word usage, see the [Contribution guide][contribution-guide]

# Review checklists

Expand All @@ -31,3 +31,5 @@ Reviewers: use this section to ensure you have checked everything before approvi
* [ ] If the page index was updated, are redirects required
and have they been implemented?
* [ ] Have you checked the built version of this content?

[contribution-guide]: https://github.com/timescale/docs/blob/latest/CONTRIBUTING.md
10 changes: 5 additions & 5 deletions .github/styles/templates/procedure.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ of the same thing:
You have \<what the user will do in this section>.

<!-- Add links here as variables -->
[workflow-diagram]: https://plantuml.com/activity-diagram-beta

[create-a-service]: /getting-started/:currentVersion:/services
[secure-vpc-aws]: /use-timescale/:currentVersion:/vpc/
[install-linux]: /self-hosted/:currentVersion:/install/installation-linux/
[gdsg]: https://developers.google.com/style/highlights

[verb-what-the-user-will-do-link]: /.github/:currentVersion:/styles/templates/procedure/#verb-what-the-user-will-do
[install-linux]: /self-hosted/:currentVersion:/install/installation-linux/
[secure-vpc-aws]: /use-timescale/:currentVersion:/vpc/
[verb-what-the-user-will-do-if-the-procedure-is-cut-into-logical-sections-link]: /.github/:currentVersion:/styles/templates/procedure/#verb-what-the-user-will-do-if-the-procedure-is-cut-into-logical-sections
[verb-what-the-user-will-do-link]: /.github/:currentVersion:/styles/templates/procedure/#verb-what-the-user-will-do
[workflow-diagram]: https://plantuml.com/activity-diagram-beta
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Each major doc section has a dedicated directory with `.md` files inside, repres
Beneath the front matter, describe the error and its solution in regular Markdown. You can also use any other components allowed within the docs site.

The entry shows up on the troubleshooting pages for its associated products and topics. If the page doesn't already exist, add an entry for it in the page
index, setting `type` to `placeholder`. See [Navigation tree][navigation-tree-link].
index, setting `type` to `placeholder`. See [Edit the navigation hierarchy][navigation-tree-link].

## Edit the navigation hierarchy

Expand Down Expand Up @@ -77,7 +77,7 @@ The navigation hierarchy of a doc section is governed by `page-index/page-index.
},
```

See [Use $CLOUD_LONG section navigation][use-navigation] for reference.
See [Use Tiger Data products navigation][use-navigation] for reference.

To change the structure, add or delete pages in a section, modify the corresponding `page-index.js`. An entry in a `page-index.js` includes the following fields:

Expand Down Expand Up @@ -153,14 +153,14 @@ To make a documentation page more visible and clear for Google:

The previous documentation source is in the deprecated repository called [docs.timescale.com-content][legacy-source].

[legacy-source]: https://github.com/timescale/docs.timescale.com-content

[formatting]: _partials/_formatting_examples.md
[google-style]: https://developers.google.com/style
[legacy-source]: https://github.com/timescale/docs.timescale.com-content
[markdown-syntax]: https://www.markdownguide.org/extended-syntax/
[github-docs]: https://github.com/timescale/docs
[navigation-tree-link]: /CONTRIBUTING/:currentVersion:/#edit-the-navigation-hierarchy
[readme]: README.md
[use-navigation]: use-timescale/page-index/page-index.js
[formatting]: _partials/_formatting_examples.md
[variables]: https://www.tigerdata.com/docs/variables-for-contributors/
[readme]: README.md

[navigation-tree-link]: /CONTRIBUTING/:currentVersion:/#navigation-tree

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ See the [Contributing guide](CONTRIBUTING.md) for style and language guidance.

## Learn about Tiger Data

Tiger Data is Postgres made powerful. To learn more about the company and its products, visit [tigerdata.com](https://www.tigerdata.com).
Tiger Data is Postgres made powerful. To learn more about the company and its products, visit [tigerdata.com][tigerdata-home].

[docs-issues]: https://github.com/timescale/docs/issues
[github-fork]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo
[github-clone]: https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository
[gatsby]: https://www.gatsbyjs.com/
[github-clone]: https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository
[github-fork]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo
[tigerdata-home]: https://www.tigerdata.com
16 changes: 9 additions & 7 deletions _code-samples/toolkit/two-step_aggregation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ The inner aggregate call creates a machine-readable partial form that can be use
While the one-step calling convention is easier for the simple case, it becomes much more difficult and hard to reason about for slightly more complex use-cases detailed in the next section. We wanted the calling convention to remain consistent and easy to reason about so you can take advantage of the same functions even as you start doing more complicated analyses. This also to keeps the docs consistent and prevents adding special cases everywhere.

## Why We Use Two-Step Aggregates <a id="two-step-philosophy"></a>
Interestingly, almost all $PG aggregates do a version of this [under the hood already](https://www.postgresql.org/docs/current/xaggr.html), where they have an internal state used for aggregation and then a final function that displays the output to the user.
Interestingly, almost all $PG aggregates do a version of this [under the hood already][under-the-hood-already], where they have an internal state used for aggregation and then a final function that displays the output to the user.

So why do we make this calling convention explicit?

1. It allows different accessor function calls to use the same internal state and not redo work.
2. It cleanly distinguishes the parameters that affect the aggregate and those that only affect the accessor.
3. It makes it explicit how and when aggregates can be re-aggregated or "stacked" on themselves with logically consistent results. This also helps them better integrate with [continuous aggregates](/use-timescale/latest/continuous-aggregates).
3. It makes it explicit how and when aggregates can be re-aggregated or "stacked" on themselves with logically consistent results. This also helps them better integrate with [continuous aggregates][continuous-aggregates].
4. It allows for better retrospective analysis of downsampled data in continuous aggregates.

That might have been gibberish to some, so let's unpack it a bit.
Expand Down Expand Up @@ -92,11 +92,11 @@ SELECT
approx_percentile(0.5, uddsketch(100, 0.01, val)) as less_accurate_median -- modify the terms for the aggregate get a new approximation
FROM foo;
```
Here we can see which parameters are for the `uddsketch` aggregate (the number of buckets and the target error), and which arguments are for`approx_percentile` (the approx_percentile we want to extract). The optimizer will correctly combine the calls for the first two `uddsketch` calls but not for the third. It is also more clear to the user what is going on, and that I can't set my target error at read time, but rather only at calculation time (this is especially helpful for understanding the behavior of [continuous aggregates][continuous-aggregates]).
Here we can see which parameters are for the `uddsketch` aggregate (the number of buckets and the target error), and which arguments are for`approx_percentile` (the approx_percentile we want to extract). The optimizer will correctly combine the calls for the first two `uddsketch` calls but not for the third. It is also more clear to the user what is going on, and that I can't set my target error at read time, but rather only at calculation time (this is especially helpful for understanding the behavior of [continuous aggregates][caggs]).

Combining all of these into one function, so we can use the one-step approach, can get unwieldy and unclear very quickly (ie imagine something like `approx_percentile_uddsketch(0.5, 1000, 0.001)`).
<br>
### Stacked aggregates and [continuous aggregate][continuous-aggregates] integration <a id="philosophy-reagg"></a>
### Stacked aggregates and [continuous aggregate][caggs] integration <a id="philosophy-reagg"></a>
Aggregates can be divided into two classes: ones that are "stackable" in their final form and ones that are not.
What I'm calling stackable aggregates are ones like `sum`, `min`, `max` etc. that can be re-aggregated on themselves at different groupings without losing their meaning, ie:

Expand Down Expand Up @@ -125,7 +125,7 @@ Or to say it more succinctly: the `sum` of a `sum` is the `sum` but the `avg` of

This is not to say that the `avg` of an `avg` is not a useful piece of information, it can be in some cases, but it isn't always what you want and it can be difficult to actually get the true value for non-stackable aggregates, for instance, for `avg` we can take the `count` and `sum` and divide the `sum` by the `count`, but for many aggregates this is not so obvious and for something like `percentile_agg` __LINK__ with a one-step aggregate, the user would simply have to re-implement most of the algorithm in SQL in order to get the result they want.

Two-step aggregates expose the internal, re-aggregateable form to the user so they can much more easily do this work, so we've tried to provide two-step aggregates wherever we can. This is especially useful for working with [continuous aggregates][continuous-aggregates], so if I create a continuous aggregate like so:
Two-step aggregates expose the internal, re-aggregateable form to the user so they can much more easily do this work, so we've tried to provide two-step aggregates wherever we can. This is especially useful for working with [continuous aggregates][caggs], so if I create a continuous aggregate like so:

```SQL , ignore
CREATE MATERIALIZED VIEW foo_15
Expand All @@ -151,6 +151,8 @@ GROUP BY id, time_bucket('1 day'::interval, bucket)
##### NB: There are some two-step aggregates like `tdigest` __ADD LINK? and expose and other bits...__ when we document that function where two-step aggregation can lead to more error or different results, because the algorithm is not deterministic in its re-aggregation, but we will note that clearly in the documentation when that happens, it is unusual.

### Retrospective analysis over downsampled data <a id="philosophy-retro"></a>
[Continuous aggregates][continuous-aggregates] (or separate aggregation tables powered by a cron job or a [custom job]( __LINK__ ) ) aren't just used for speeding up queries, they're also used for [data retention]( __LINK__ ). But this can mean that they are very difficult to modify as your data ages. Unfortunately this is also when you are learning more things about the analysis you want to do on your data. By keeping them in their raw aggregate form, the user has the flexibility to apply different accessors to do retrospective analysis. With a one-step aggregate the user needs to determine, say, which percentiles are important when we create the continous aggregate, with a two-step aggregate the user can simply determine they're going to want an approximate percentile, and then determine when doing the analysis whether they want the median, the 90th, 95th or 1st percentile. No need to modify the aggregate or try to re-calculate from data that may no longer exist in the system.
[Continuous aggregates][caggs] (or separate aggregation tables powered by a cron job or a custom job aren't just used for speeding up queries, they're also used for data retention. But this can mean that they are very difficult to modify as your data ages. Unfortunately this is also when you are learning more things about the analysis you want to do on your data. By keeping them in their raw aggregate form, the user has the flexibility to apply different accessors to do retrospective analysis. With a one-step aggregate the user needs to determine, say, which percentiles are important when we create the continuous aggregate, with a two-step aggregate the user can simply determine they're going to want an approximate percentile, and then determine when doing the analysis whether they want the median, the 90th, 95th or 1st percentile. No need to modify the aggregate or try to re-calculate from data that may no longer exist in the system.

[continuous-aggregates]: /use-timescale/:currentVersion:/continuous-aggregates/about-continuous-aggregates/
[caggs]: /use-timescale/:currentVersion:/continuous-aggregates/about-continuous-aggregates/
[continuous-aggregates]: /use-timescale/:currentVersion:/continuous-aggregates
[under-the-hood-already]: https://www.postgresql.org/docs/current/xaggr.html
3 changes: 1 addition & 2 deletions _partials/_2-step-aggregation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ The two-step aggregation pattern has several advantages:
To learn more, see the [blog post on two-step
aggregates][blog-two-step-aggregates].

[blog-two-step-aggregates]: https://www.timescale.com/blog/how-postgresql-aggregation-works-and-how-it-inspired-our-hyperfunctions-design
[blog-two-step-aggregates]: https://www.tigerdata.com/blog/how-postgresql-aggregation-works-and-how-it-inspired-our-hyperfunctions-design
[caggs]: /use-timescale/:currentVersion:/continuous-aggregates/about-continuous-aggregates/

7 changes: 5 additions & 2 deletions _partials/_add-data-blockchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ dataset and copy the data to your database.
file that contains Bitcoin transactions for the past five days. Download:

<Tag type="download">
[bitcoin_sample.zip](https://assets.timescale.com/docs/downloads/bitcoin-blockchain/bitcoin_sample.zip)

[bitcoin_sample.zip][bitcoin_samplezip]

</Tag>

1. In a new terminal window, run this command to unzip the `.csv` files:
Expand All @@ -39,6 +41,7 @@ dataset and copy the data to your database.

</Procedure>

[satoshi-def]: https://www.pcmag.com/encyclopedia/term/satoshi
[bitcoin_samplezip]: https://assets.timescale.com/docs/downloads/bitcoin-blockchain/bitcoin_sample.zip
[coinbase-def]: https://www.pcmag.com/encyclopedia/term/coinbase-transaction
[connect-using-psql]: /integrations/:currentVersion:/psql#connect-to-your-service
[satoshi-def]: https://www.pcmag.com/encyclopedia/term/satoshi
8 changes: 7 additions & 1 deletion _partials/_add-data-energy.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ into the `metrics` hypertable.
<Procedure>

<Highlight type="important">

This is a large dataset, so it might take a long time, depending on your network
connection.

</Highlight>

1. Download the dataset:

<Tag type="download">
[metrics.csv.gz](https://assets.timescale.com/docs/downloads/metrics.csv.gz)

[metrics.csv.gz][metricscsvgz]

</Tag>

1. Use your file manager to decompress the downloaded dataset, and take a note
Expand Down Expand Up @@ -46,3 +50,5 @@ connection.
```

</Procedure>

[metricscsvgz]: https://assets.timescale.com/docs/downloads/metrics.csv.gz
8 changes: 7 additions & 1 deletion _partials/_add-data-nyctaxis.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ When you have your database set up, you can load the taxi trip data into the
<Procedure>

<Highlight type="important">

This is a large dataset, so it might take a long time, depending on your network
connection.

</Highlight>

1. Download the dataset:

<Tag type="download">
[nyc_data.tar.gz](https://assets.timescale.com/docs/downloads/nyc_data.tar.gz)

[nyc_data.tar.gz][nyc_datatargz]

</Tag>

1. Use your file manager to decompress the downloaded dataset, and take a note
Expand Down Expand Up @@ -58,3 +62,5 @@ tolls_amount | 0
improvement_surcharge | 0.3
total_amount | 10.3
```

[nyc_datatargz]: https://assets.timescale.com/docs/downloads/nyc_data.tar.gz
9 changes: 5 additions & 4 deletions _partials/_add-data-twelvedata-crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ download the dataset, then upload the data to your $SERVICE_LONG.
<Procedure>


1. Unzip <Tag type="download">[crypto_sample.zip](https://assets.timescale.com/docs/downloads/candlestick/crypto_sample.zip)</Tag> to a `<local folder>`.
1. Unzip <Tag type="download">[crypto_sample.zip][crypto_samplezip]</Tag> to a `<local folder>`.

This test dataset contains second-by-second trade data for the most-traded crypto-assets
and a regular table of asset symbols and company names.
Expand Down Expand Up @@ -43,7 +43,8 @@ download the dataset, then upload the data to your $SERVICE_LONG.

</Procedure>

[twelve-data]: https://twelvedata.com/
[migrate-with-downtime]: /migrate/:currentVersion:/pg-dump-and-restore/
[crypto_samplezip]: https://assets.timescale.com/docs/downloads/candlestick/crypto_sample.zip
[data-ingest]: /migrate/:currentVersion:/
[migrate-live]: /migrate/:currentVersion:/live-migration/
[data-ingest]: /use-timescale/:currentVersion:/ingest-data/
[migrate-with-downtime]: /migrate/:currentVersion:/pg-dump-and-restore/
[twelve-data]: https://twelvedata.com/
5 changes: 2 additions & 3 deletions _partials/_add-data-twelvedata-stocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ dataset and copy the data to your database.
files; one with company information, and one with real-time stock trades for
the past month. Download:

<Tag type="download">
[real_time_stock_data.zip](https://assets.timescale.com/docs/downloads/get-started/real_time_stock_data.zip)
</Tag>
<Tag type="download">[real_time_stock_data.zip][real_time_stock_datazip]</Tag>

1. In a new terminal window, run this command to unzip the `.csv` files:

Expand All @@ -40,4 +38,5 @@ dataset and copy the data to your database.

</Procedure>

[real_time_stock_datazip]: https://assets.timescale.com/docs/downloads/get-started/real_time_stock_data.zip
[twelve-data]: https://twelvedata.com/
4 changes: 2 additions & 2 deletions _partials/_aws-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The features included in each [$PRICING_PLAN][pricing-plans] are:

For a personalized quote, [get in touch with $COMPANY][contact-company].

[pricing-plans]: https://www.timescale.com/pricing
[commercial-sla]: https://www.tigerdata.com/legal/terms-of-service
[contact-company]: https://www.tigerdata.com/contact/
[hipaa-compliance]: https://www.hhs.gov/hipaa/for-professionals/index.html
[commercial-sla]: https://www.timescale.com/legal/timescale-cloud-terms-of-service
[pricing-plans]: https://www.tigerdata.com/pricing
4 changes: 2 additions & 2 deletions _partials/_azure-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The features included in each [$PRICING_PLAN][pricing-plans] are:

For a personalized quote, [get in touch with $COMPANY][contact-company].

[pricing-plans]: https://www.timescale.com/pricing
[commercial-sla]: https://www.tigerdata.com/legal/terms-of-service
[contact-company]: https://www.tigerdata.com/contact/
[hipaa-compliance]: https://www.hhs.gov/hipaa/for-professionals/index.html
[commercial-sla]: https://www.timescale.com/legal/timescale-cloud-terms-of-service
[pricing-plans]: https://www.tigerdata.com/pricing
4 changes: 3 additions & 1 deletion _partials/_beta.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This feature is in beta. Beta features are experimental, and should not be used
on production systems. If you have feedback, reach out to your customer success
manager, or [contact us](https://www.tigerdata.com/contact/).
manager, or [contact us][contact-us].

</Highlight>

[contact-us]: https://www.tigerdata.com/contact/
Loading