Skip to main content

// advent-of-postgres/day-24

Day 24 of 24AdvancedAvailability mathRangesAnti-joins

The Launch Readiness Check

The last check before the big night: which services met their availability target this month, with planned maintenance left out.

Opens 24 December 2026, 00:00 UTC

It is 24 December. Before the sleigh takes off, Alabaster runs one last check: every service promised 99.95% availability for December, and only the services that kept the promise get to stay live tonight without an elf watching them.

Every service was checked once a minute from 1 to 23 December, in checks:

Column Type Notes
service text Part of the primary key
checked_at timestamptz Every minute
ok boolean false when it failed

Some services had planned work, announced in advance, in planned_maintenance:

Column Type Notes
service text Which service
window_ tstzrange [start, end): the end is not included

A service's availability is the share of its checks that passed, leaving out the checks inside its own planned maintenance windows. A service meets the target when that share is 99.95% (0.9995) or more.

Your task

How many services met the 99.95% target?

Submit the number.

Stuck? Show a hint

Leave out every check that falls inside its own service's maintenance window (a range contains a timestamp with @>), then compare the share of ok checks with 0.9995.

No database yet. You get a real Postgres database on Neon, free, with no account.
One statement at a time. Ctrl+Enter or Cmd+Enter runs it.

Download today's data as SQL to solve it on your own Postgres (14 or later).

Solved this puzzle? Share it.

Tag @thedevopsdaily and share it with the community.