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?.
CREATE TABLE
CREATE TABLE
CREATE TABLE
INSERT 0 2
weeknr | data |
---|---|
14 | foo |
SELECT 1
QUERY PLAN |
---|
Limit (cost=0.00..25.88 rows=6 width=36) |
-> Seq Scan on metric_event_14 metric_event (cost=0.00..25.88 rows=6 width=36) |
Filter: (weeknr = 14) |
EXPLAIN
QUERY PLAN |
---|
Limit (cost=0.00..48.47 rows=10 width=36) |
-> Append (cost=0.00..58.16 rows=12 width=36) |
-> Seq Scan on metric_event_14 metric_event_1 (cost=0.00..29.05 rows=6 width=36) |
Filter: ((weeknr)::numeric = '14'::numeric) |
-> Seq Scan on metric_event_15 metric_event_2 (cost=0.00..29.05 rows=6 width=36) |
Filter: ((weeknr)::numeric = '14'::numeric) |
EXPLAIN
QUERY PLAN |
---|
Limit (cost=0.00..48.47 rows=10 width=36) |
-> Append (cost=0.00..58.16 rows=12 width=36) |
-> Seq Scan on metric_event_14 metric_event_1 (cost=0.00..29.05 rows=6 width=36) |
Filter: ((weeknr)::double precision = '14'::double precision) |
-> Seq Scan on metric_event_15 metric_event_2 (cost=0.00..29.05 rows=6 width=36) |
Filter: ((weeknr)::double precision = '14'::double precision) |
EXPLAIN