5 PostgreSQL Functions for Monitoring & Analytics
#PostgreSQL is ideal for real-time monitoring and historical analysis, but how do you write *efficient* queries to track real-time performance metrics and spot trends?
We know it can be tricky, and in this coding session, @avthars demos his favorite (essential!) queries for common #DevOps scenarios, including TimescaleDB-specific functions for complex #timeseries analysis.
Youโll get tips, best practices, and resources, so you leave ready to customize each query for your projects.
๐ ๐ฅ๐ฒ๐น๐ฒ๐๐ฎ๐ป๐ ๐ฅ๐ฒ๐๐ผ๐๐ฟ๐ฐ๐ฒ๐
๐ Get the Air Quality sample app (ft in our demo) โ https://tsdb.co/air-qual-repo
๐ Check out more advanced analytic functions (Timescale Docs) โ https://tsdb.co/advanced-queries-docs
๐ Learn key SQL functions for time-series analysis โ https://tsdb.co/time-series-sql
๐ Join Timescale Developer Slack โ https://tsdb.co/TimescaleSlack
๐ Start a free Timescale Cloud trial ($300 in cloud credits to start ๐) โ https://tsdb.co/get-started-cloud
๐ฏ ๐๐ฏ๐ผ๐๐ ๐ง๐ถ๐บ๐ฒ๐๐ฐ๐ฎ๐น๐ฒ
At Timescale, we are dedicated to serving developers worldwide, enabling them to build exceptional data-driven products that measure everything that matters. Analyzing this data across the time dimension (โtime-series dataโ) enables developers to understand what is happening right now, how that is changing, and why that is changing. We are backed by top-tier investors with a track record of success in the industry.
๐ป ๐๐ถ๐ป๐ฑ ๐จ๐ ๐ข๐ป๐น๐ถ๐ป๐ฒ!
๐ Website โ https://tsdb.co/homepage
๐ Slack โ https://slack.timescale.com
๐ GitHub โ https://github.com/timescale
๐ Twitter โ https://twitter.com/timescaledb
๐ Twitch โ https://www.twitch.tv/timescaledb
๐ LinkedIn โ https://www.linkedin.com/company/timescaledb
๐ Timescale Blog โ https://tsdb.co/blog
๐ Timescale Documentation โ https://tsdb.co/docs
๐ ๐๐ต๐ฎ๐ฝ๐๐ฒ๐ฟ๐:
โฑ 0:00 โ Introduction
โฑ 2:44 โ Roadmap & motivation: what youโll learn and why it matters
โฑ 4:37 โ Why use Postgres for monitoring and analytics?
โฑ 7:18 โ Demo scenario, real-world dataset, and schema
โฑ 13:32 โ Function #1: Using Window Functions
โฑ 19:20 โ Function #2: Using Window Functions & LAG()
โฑ 25:51 โ Function #3: Using percentile_cont()
โฑ 29:30 โ TimescaleDB-unique functions (and quick background on TimescaleDB)
โฑ 30:36 โ Function #4: Using first() or last()
โฑ 34:10 โ Function #5: Using time_bucket
โฑ 39:16 โ (Bonus!) Function. #6: Using time_bucket_gapfill(); locf(), interpolate()
โฑ 46:45 โ Recap & Resources