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?.
CREATE TABLE
INSERT 0 13
CREATE INDEX
CREATE INDEX
CREATE INDEX
parent_id message_id posted_at share_count
23 9 2015-01-08 00:00:00 4931
null 3 2015-01-04 00:00:00 3411
null 2 2015-01-03 00:00:00 3411
22 6 2015-01-07 00:00:00 533
null 13 2015-01-12 00:00:00 444
21 12 2015-01-11 00:00:00 123
null 11 2015-01-10 00:00:00 0
SELECT 7
parent_id message_id posted_at share_count
23 9 2015-01-08 00:00:00 4931
null 3 2015-01-04 00:00:00 3411
null 2 2015-01-03 00:00:00 3411
22 6 2015-01-07 00:00:00 533
null 13 2015-01-12 00:00:00 444
21 12 2015-01-11 00:00:00 123
null 11 2015-01-10 00:00:00 0
SELECT 7