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?.
15 rows affected
the_date value
2018-03-31 1
2018-05-31 4000000
2018-06-01 10
2018-12-31 20
2019-03-31 30
2019-05-31 4000000
2019-06-01 100
2019-12-31 200
2020-03-31 300
2020-05-31 4000000
2020-06-01 1000
2020-12-31 2000
2021-03-31 3000
2021-05-31 4000000
2021-06-01 10000
the_date value ?column?
2018-03-31 1 2017-10-31 00:00:00
2018-05-31 4000000 2017-12-31 00:00:00
2018-06-01 10 2018-01-01 00:00:00
2018-12-31 20 2018-07-31 00:00:00
2019-03-31 30 2018-10-31 00:00:00
2019-05-31 4000000 2018-12-31 00:00:00
2019-06-01 100 2019-01-01 00:00:00
2019-12-31 200 2019-07-31 00:00:00
2020-03-31 300 2019-10-31 00:00:00
2020-05-31 4000000 2019-12-31 00:00:00
2020-06-01 1000 2020-01-01 00:00:00
2020-12-31 2000 2020-07-31 00:00:00
2021-03-31 3000 2020-10-31 00:00:00
2021-05-31 4000000 2020-12-31 00:00:00
2021-06-01 10000 2021-01-01 00:00:00
the_date value ?column?
2018-03-31 1 2017-10-31 00:00:00
2018-06-01 10 2018-01-01 00:00:00
2018-12-31 20 2018-07-31 00:00:00
2019-03-31 30 2018-10-31 00:00:00
2019-06-01 100 2019-01-01 00:00:00
2019-12-31 200 2019-07-31 00:00:00
2020-03-31 300 2019-10-31 00:00:00
2020-06-01 1000 2020-01-01 00:00:00
2020-12-31 2000 2020-07-31 00:00:00
2021-03-31 3000 2020-10-31 00:00:00
2021-06-01 10000 2021-01-01 00:00:00
the_date value date_part
2018-03-31 1 2017
2018-06-01 10 2018
2018-12-31 20 2018
2019-03-31 30 2018
2019-06-01 100 2019
2019-12-31 200 2019
2020-03-31 300 2019
2020-06-01 1000 2020
2020-12-31 2000 2020
2021-03-31 3000 2020
2021-06-01 10000 2021
the_date value sum
2018-03-31 1 1
2018-06-01 10 60
2018-12-31 20 60
2019-03-31 30 60
2019-06-01 100 600
2019-12-31 200 600
2020-03-31 300 600
2020-06-01 1000 6000
2020-12-31 2000 6000
2021-03-31 3000 6000
2021-06-01 10000 10000