~/talk

Using a database in a data science project - Lessons learned in production

slides:none on file

System handles real traffic (up to five ticket sales per second), recalculates millions of predictions daily, and keeps data fresh by ingesting CDC into a Postgres replica via Kafka CDC. Performance wins come from postgres materialized views, unlogged tables and COPY or prepared statements (psycopg2/psycopg3) for bulk writes, and precomputed day‑wise snapshots stored as parquet+snappy files to avoid repeated heavy queries. Query profiling through a single SQL helper exposes the 20/80 hotspots so optimizations target the real bottlenecks.

AI-written summary · about

  1. 0:00Start
  2. 6:43ETL steps using materialized views (based on normal views) A cronjob can refresh a materialized view the code is on the schema and easy to inspect. When based on a view it's trivial to switch to have fresh data and benchmark
  3. 13:34Ways to insert a lot of data quickly .execute_many is the bare minimum • COPY is the best way when upsert is not needed • Unlogged tables are faster to create for temporary data
  4. 24:49ETL steps using materialized views (based on normal views) A cronjob can refresh a materialized view, the code is on the schema and easy to inspect. When based on a view it's trivial to switch to have fresh data and benchmark
~/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.