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?.
version
PostgreSQL 12.14 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-16), 64-bit
SELECT 1
CREATE TABLE
INSERT 0 2
the_date
2021-08-29 00:00:00+01
2021-08-30 00:00:00+01
2021-08-31 00:00:00+01
2021-09-01 00:00:00+01
2021-09-02 00:00:00+01
2021-09-03 00:00:00+01
2021-09-04 00:00:00+01
2021-09-05 00:00:00+01
2021-09-06 00:00:00+01
2021-09-07 00:00:00+01
2021-09-08 00:00:00+01
2021-09-09 00:00:00+01
2021-09-10 00:00:00+01
2021-09-11 00:00:00+01
2021-09-12 00:00:00+01
2021-09-13 00:00:00+01
2021-09-14 00:00:00+01
2021-09-15 00:00:00+01
2021-09-16 00:00:00+01
2021-09-17 00:00:00+01
2021-09-18 00:00:00+01
2021-09-19 00:00:00+01
2021-09-20 00:00:00+01
2021-09-21 00:00:00+01
2021-09-22 00:00:00+01
2021-09-23 00:00:00+01
2021-09-24 00:00:00+01
2021-09-25 00:00:00+01
2021-09-26 00:00:00+01
2021-09-27 00:00:00+01
2021-09-28 00:00:00+01
2021-09-29 00:00:00+01
SELECT 32
the_date date_part to_char
2021-08-30 00:00:00+01 1 Monday
2021-08-31 00:00:00+01 2 Tuesday
2021-09-01 00:00:00+01 3 Wednesday
2021-09-02 00:00:00+01 4 Thursday
2021-09-03 00:00:00+01 5 Friday
2021-09-06 00:00:00+01 1 Monday
2021-09-07 00:00:00+01 2 Tuesday
2021-09-08 00:00:00+01 3 Wednesday
2021-09-09 00:00:00+01 4 Thursday
2021-09-10 00:00:00+01 5 Friday
2021-09-13 00:00:00+01 1 Monday
2021-09-14 00:00:00+01 2 Tuesday
2021-09-15 00:00:00+01 3 Wednesday
2021-09-16 00:00:00+01 4 Thursday
2021-09-17 00:00:00+01 5 Friday
2021-09-20 00:00:00+01 1 Monday
2021-09-21 00:00:00+01 2 Tuesday
2021-09-22 00:00:00+01 3 Wednesday
2021-09-23 00:00:00+01 4 Thursday
2021-09-24 00:00:00+01 5 Friday
2021-09-27 00:00:00+01 1 Monday
2021-09-28 00:00:00+01 2 Tuesday
2021-09-29 00:00:00+01 3 Wednesday
SELECT 23