Incident Lab · SEV3 · Postgres
Conversion rate is 0% every day
Growth: the funnel dashboard says nobody has converted since we moved it to Postgres. Orders look normal.
daily funnel.visits and daily funnel.orders are both INTEGER . In Postgres, orders / visits with two integers is integer division : the result is truncated, so 37 / 1250 = 0. (DuckDB spells integer division // , which is how the starter reproduces it.) There's a second trap. On October 6 the tracking script was down and visits is 0. Postgres fails the whole query with division by zero . Investigate: Fix conversion by day so the rate is a real number. Columns: day , visits , orders , conversion pct = 100 × orders ÷ visits rounded to 2 (so 37 / 1250 → 2.96), and NULL when visits is 0. Order by day .
