~/talk

How PostgreSQL aggregates work and how to create and use custom...

Talkat PGConf NYC 2021 · 2021-12-02..12-03· [databases]
links:none on file
slides:none on file

Explains how PostgreSQL aggregates maintain state with transition, combine, and final functions, how parallel aggregation and serialization work, and why custom aggregates can be marked parallel safe. Shows building aggregates in SQL and in PGX the Rust-based framework used to generate and test code, with examples (approximate percentiles using UDD sketch), a two-step aggregate pattern with rollup/rolling accessors, and a toolkit managing 600+ custom types and functions to make these approaches practical and performant.

AI-written summary · about

  1. 0:00Introduction
  2. 1:20Aggregates vs Functions
  3. 2:48How aggregates work
  4. 3:37State transition function
  5. 3:58Complex aggregates
  6. 5:45Parallelization
  7. 8:42Create Aggregate Statement
  8. 10:15SQL Aggregate Example
  9. 16:52Two Step Aggregate Design
  10. 17:52Two Step Aggregate Functions
  11. 20:32Deduplication
  12. 22:42Aggregate vs Accessor
  13. 25:08Rollup
  14. 29:00Questions
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.