Skip to content

Instantly share code, notes, and snippets.

@Opus1no2
Last active October 3, 2018 11:55
Show Gist options
  • Save Opus1no2/acc587f7d996572662a428720299b95e to your computer and use it in GitHub Desktop.
Save Opus1no2/acc587f7d996572662a428720299b95e to your computer and use it in GitHub Desktop.
oh postgres
select g.n, count(rt.latency), coalesce(max(rt.latency), 0), coalesce(min(rt.latency), 0)
from generate_series(1, 20) g(n) left join
run_times rt
on width_bucket(rt.latency, 0, 1, 20) = g.n
group by g.n
order by g.n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment