Indeed. Previously, when computing latency histograms from sampled events, I've abused DuckDB SQL cross join/cartesian products to generate zero values for "empty buckets" within a single SQL statement [1]. But makes the SQL unnecessarily complex & slower too, so I quickly moved that empty bucket rendering functionality to the frontend...
[1]: Example DuckDB SQL with generated bucket lists and cross join + outer join: https://github.com/tanelpoder/0xtools/blob/master/tools/sql/...