Skip to content

Files

Latest commit

Dec 15, 2023
f400df2 · Dec 15, 2023

History

History
80 lines (51 loc) · 4.15 KB

20210715_04.md

File metadata and controls

80 lines (51 loc) · 4.15 KB

PostgreSQL timescaledb 时序数据库 Hyperfunctions 时序数据分析函数

作者

digoal

日期

2021-07-15

标签

PostgreSQL , Hyperfunctions , timescaledb


背景

https://blog.timescale.com/blog/introducing-hyperfunctions-new-sql-functions-to-simplify-working-with-time-series-data-in-postgresql/

Today, we’re excited to launch TimescaleDB hyperfunctions, a series of SQL functions within TimescaleDB that make it easier to manipulate and analyze time-series data in PostgreSQL with fewer lines of code. You can use hyperfunctions to calculate percentile approximations of data, compute time-weighted averages, downsample and smooth data, and perform faster COUNT DISTINCT queries using approximations. Moreover, hyperfunctions are “easy” to use: you call a hyperfunction using the same SQL syntax you know and love.

At Timescale, our mission is to enable every software developer to store, analyze, and build on top of their time-series data, so that they can measure what matters in their world: IoT devices, IT systems, marketing analytics, user behavior, financial metrics, and more. (For example, we’ve built a free multi-node, petabyte-scale, time-series database; a multi-cloud, fully-managed service for time-series data; and Promscale, an open-source analytics platform for Prometheus monitoring data.)

https://docs.timescale.com/api/latest/hyperfunctions/

Hyperfunctions

TimescaleDB hyperfunctions are a series of SQL functions within TimescaleDB that make it easier to manipulate and analyze time-series data in PostgreSQL with fewer lines of code. You can use hyperfunctions to easily aggregate data into consistent buckets of time, calculate percentile approximations of data, compute time-weighted averages, downsample and smooth data, and perform faster COUNT DISTINCT queries using approximations.

Hyperfunctions are “easy” to use: you call a hyperfunction using the same SQL syntax you know and love.

  • approximate_row_count
  • first
  • last
  • histogram
  • time_bucket
  • Gapfilling and Interpolation
    • time_bucket_gapfill
    • locf
    • interpolate
  • Percentile Approximation
    • percentile_agg
    • approx_percentile
    • approx_percentile_rank
    • rollup
    • max_val
    • mean
    • error
    • min_val
    • num_vals
    • Advanced Aggregation Methods
      • uddsketch
      • tdigest
  • Time Weighted Averages
    • time_weight
    • rollup
    • average

您的愿望将传达给PG kernel hacker、数据库厂商等, 帮助提高数据库产品质量和功能, 说不定下一个PG版本就有您提出的功能点. 针对非常好的提议,奖励限量版PG文化衫、纪念品、贴纸、PG热门书籍等,奖品丰富,快来许愿。开不开森.

digoal's wechat