Live data from Hacker News

How PostgreSQL aggregation works and how it inspired our hyperfunctions’ design

blog.timescale.com

1–10 of 33 posts

Re: How PostgreSQL aggregation works and how it inspired our hyperfunctions’ design

#4

Noob question: Can you have time-series tables and regular Postgres tables in the same database? Is this distinction something that you decide on when you create a table?

Yes you can have both in the same database. We actually use TimescaleDB exactly that way, well at least for now. We'll in the process of separating certain tables out, so make it possible to select a pg database based on async or sync replication.

In terms of creating a Hypertable (TimescaleDB table) you create the normal table first and then transform it into a Hypertable.

Re: How PostgreSQL aggregation works and how it inspired our hyperfunctions’ design

#5

Noob question: Can you have time-series tables and regular Postgres tables in the same database? Is this distinction something that you decide on when you create a table?

Yes you can, and yes you make the decision table by table. 'CREATE TABLE` is the same in either case, then `create_hypertable` to make it a timeseries table https://docs.timescale.com/api/latest/hypertable/create_hype...

Re: How PostgreSQL aggregation works and how it inspired our hyperfunctions’ design

#6

Noob question: Can you have time-series tables and regular Postgres tables in the same database? Is this distinction something that you decide on when you create a table?

Yes! It's a nice benefit of TimescaleDB being built on top of Postgres.

Re: How PostgreSQL aggregation works and how it inspired our hyperfunctions’ design

#8

That is a pretty good and detailed blog post. I wonder, however, if I can use any aggregate call to build out a continuous aggregate. I'm specifically think about things like sketches and hyperloglogs.

(NB: Post author here)

Yes! You can use any of the hyperfunction aggregates to build a continuous agg. Including sketches like the percentile approximation stuff.

With hyperloglog, it's still experimental, so you have to jump through some hoops to get it into a continuous agg as it could be dropped on next release, but once that's been stabilized it'll be very easy to use in continuous aggs. Feel free to test now, just know that it may get dropped and you'd have to re-create the continuous agg after the next release when it gets stabilized.

Re: How PostgreSQL aggregation works and how it inspired our hyperfunctions’ design

#9
post #8

That is a pretty good and detailed blog post. I wonder, however, if I can use any aggregate call to build out a continuous aggregate. I'm specifically think about things like sketches and hyperloglogs.

(NB: Post author here) Yes! You can use any of the hyperfunction aggregates to build a continuous agg. Including sketches like the percentile approximation stuff. With hyperloglog, it's still experimental, so you have to jump through some hoops to get it into a continuous agg as it could be dropped on next release, but once that's been stabilized it'll be very easy to use in continuous aggs. Feel free to test now, ju…

Interesting article!

I was wondering if there plans for supporting Continuous Aggregates on Distributed hypertables? Its currently listed as not supported under the limitations docs page.

I think the two would fit together perfectly as it will allow users to aggregate very large tables.

Re: How PostgreSQL aggregation works and how it inspired our hyperfunctions’ design

#10

Noob question: Can you have time-series tables and regular Postgres tables in the same database? Is this distinction something that you decide on when you create a table?

Yes you can have both in the same database. We actually use TimescaleDB exactly that way, well at least for now. We'll in the process of separating certain tables out, so make it possible to select a pg database based on async or sync replication. In terms of creating a Hypertable (TimescaleDB table) you create the normal table first and then transform it into a Hypertable.

> ... make it possible to select a pg database based on async or sync replication

Can you explain why you doing this? Is this application data vs. time-series?

Post reply on HN