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?.
oid | extname | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition |
---|---|---|---|---|---|---|---|
16385 | btree_gist | 10 | 16384 | t | 1.5 | null | null |
SELECT 1
CREATE TABLE
CREATE FUNCTION
CREATE FUNCTION
INSERT 0 5
INSERT 0 8
INSERT 0 2
hoo_id | shop_id | hours |
---|---|---|
1 | 1 | ["1996-01-01 12:00:00","1996-01-01 17:00:00"] |
2 | 1 | ["1996-01-03 18:30:00","1996-01-04 05:00:00"] |
3 | 1 | ["1996-01-04 22:33:00","1996-01-06 13:44:00"] |
4 | 1 | ["1996-01-07 22:00:00","1996-01-08 00:00:00"] |
5 | 1 | ["1996-01-01 00:00:00","1996-01-01 10:00:00"] |
6 | 2 | ["1996-01-01 12:00:00","1996-01-01 17:00:00"] |
7 | 2 | ["1996-01-01 00:00:00","1996-01-01 10:00:00"] |
8 | 2 | ["1996-01-07 22:00:00","1996-01-08 00:00:00"] |
9 | 3 | ["1996-01-01 00:00:00","1996-01-01 04:00:00"] |
10 | 3 | ["1996-01-07 20:00:00","1996-01-08 00:00:00"] |
11 | 4 | ["1996-01-01 04:00:00","1996-01-01 12:00:00"] |
12 | 5 | ["1996-01-01 00:00:00","1996-01-01 04:00:00"] |
13 | 5 | ["1996-01-07 22:00:00","1996-01-08 00:00:00"] |
14 | 6 | ["1996-01-01 00:00:00","1996-01-01 08:00:00"] |
15 | 7 | ["1996-01-01 00:00:00","1996-01-01 08:00:00"] |
SELECT 15
hoo_id | shop_id | hours |
---|---|---|
3 | 1 | ["1996-01-04 22:33:00","1996-01-06 13:44:00"] |
SELECT 1