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 11.5 (Debian 11.5-3.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
26 rows affected
id the_time the_value
1 1 10
1 2 10
1 3 7
1 4 8
1 5 6
1 6 5
1 7 4
1 8 3
1 9 7
1 10 10
1 11 3
1 12 8
1 13 2
1 14 1
1 15 1
2 1 10
2 2 10
2 3 10
2 4 13
2 5 6
2 6 5
2 7 4
2 8 3
2 9 7
2 10 10
2 11 12
id the_value the_time ptime change grp
1 10 1 1 0 1
1 10 2 2 0 2
1 7 3 3 1 1
1 8 4 4 1 2
1 6 5 5 1 3
1 5 6 6 1 4
1 4 7 7 1 5
1 3 8 8 1 6
1 7 9 9 1 7
1 10 10 10 0 3
1 3 11 11 1 8
1 8 12 12 1 9
1 2 13 13 1 10
1 1 14 14 1 11
1 1 15 15 1 12
2 10 1 1 0 1
2 10 2 2 0 2
2 10 3 3 0 3
2 13 4 4 0 4
2 6 5 5 1 1
2 5 6 6 1 2
2 4 7 7 1 3
2 3 8 8 1 4
2 7 9 9 1 5
2 10 10 10 0 5
2 12 11 11 0 6
id min max
1 3 9
1 11 15
2 5 9
id start_time end_time the_run_length
1 3 9 7
1 11 15 5
2 5 9 5