add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
interval ceil_ts
input timestamp 2018-05-17 22:45:30
5 min 2018-05-17 22:50:00
10 min 2018-05-17 22:50:00
hour 2018-05-17 23:00:00
day 2018-05-18 00:00:00
id ts ts1 interval ceil_ts
1 2018-05-17 22:45:30 2018-05-17 22:45:29.999999 input timestamp 2018-05-17 22:45:30
1 2018-05-17 22:45:30 2018-05-17 22:45:29.999999 5 min 2018-05-17 22:50:00
1 2018-05-17 22:45:30 2018-05-17 22:45:29.999999 10 min 2018-05-17 22:50:00
1 2018-05-17 22:45:30 2018-05-17 22:45:29.999999 hour 2018-05-17 23:00:00
1 2018-05-17 22:45:30 2018-05-17 22:45:29.999999 day 2018-05-18 00:00:00
1 2018-05-17 22:45:30 2018-05-17 22:45:29.999999 alt_day 2018-05-18 00:00:00
2 2018-05-20 00:00:00 2018-05-19 23:59:59.999999 input timestamp 2018-05-20 00:00:00
2 2018-05-20 00:00:00 2018-05-19 23:59:59.999999 5 min 2018-05-20 00:00:00
2 2018-05-20 00:00:00 2018-05-19 23:59:59.999999 10 min 2018-05-20 00:00:00
2 2018-05-20 00:00:00 2018-05-19 23:59:59.999999 hour 2018-05-20 00:00:00
2 2018-05-20 00:00:00 2018-05-19 23:59:59.999999 day 2018-05-20 00:00:00
2 2018-05-20 00:00:00 2018-05-19 23:59:59.999999 alt_day 2018-05-20 00:00:00
3 2018-05-20 00:00:00.000001 2018-05-20 00:00:00 input timestamp 2018-05-20 00:00:00.000001
3 2018-05-20 00:00:00.000001 2018-05-20 00:00:00 5 min 2018-05-20 00:05:00
3 2018-05-20 00:00:00.000001 2018-05-20 00:00:00 10 min 2018-05-20 00:10:00
3 2018-05-20 00:00:00.000001 2018-05-20 00:00:00 hour 2018-05-20 01:00:00
3 2018-05-20 00:00:00.000001 2018-05-20 00:00:00 day 2018-05-21 00:00:00
3 2018-05-20 00:00:00.000001 2018-05-20 00:00:00 alt_day 2018-05-21 00:00:00