~/talk

Optimising your Database for Analytics

Talkat PyCon Italia 2024 · 2024-05-22..05-25· [databases, data-engineering]
slides:none on file

Uses PostgreSQL and pgbench to simulate OLTP plus OLAP mixed workloads, generating ~15 million rows with scale factor 100 and measuring an analytics query that initially does external merge files and takes ~8 seconds. Raising work_mem (to 100MB then 1GB) cuts time to ~6s, adding an expression index to precompute a+ b drops it to ~5.5s, converting to a stored generated column reaches ~3s, and a materialized view hits ~2s. Recommends standby or logical replication to run analytics without impacting primary.

AI-written summary · about

  1. 0:00Introduction and background
  2. 1:12OLTP vs OLAP workloads
  3. 4:27Mixed workload challenges
  4. 7:21Setting up test environment
  5. 13:05Optimizing analytics queries
  6. 18:47Memory and time management
  7. 21:18Indexing strategies for analytics
  8. 23:24Pre-calculating and pre-aggregating data
  9. 25:59Separate analytics databases
  10. 28:08Summary and key takeaways
~/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.