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.7 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5), 64-bit |
10 rows affected
10 rows affected
5 rows affected
10 rows affected
10 rows affected
tab_name | id | exid | title | camera_id | requested_by |
---|---|---|---|---|---|
Archives | 1 | concre-r6ys | Concrete P | 1 | 1 |
Archives | 2 | 201809-27xn | 2018-09-26 | 1 | 1 |
Archives | 3 | 201902-htu9 | 2019-02-01 | 4 | 1 |
Archives | 4 | extrac-png8 | Extract | 5 | 5 |
Archives | 5 | joecli-kvpw | joe clip | 2 | 1 |
Archives | 6 | joescl-pgfl | Joe's Clip | 3 | 4 |
Archives | 7 | bartra-bnm5 | Bartra - L | 3 | 1 |
Archives | 8 | joescl-fv4u | Joe's clip | 5 | 4 |
Archives | 9 | spark-kyzrq | Sparks Bui | 1 | 1 |
Archives | 10 | 201611-luw8 | 2016-11-06 | 2 | 4 |
Compares | 1 | compa-ylxwctg | o 29th Oct | 1 | 2 |
Compares | 2 | test-hroqe | test | 2 | 3 |
Compares | 3 | compa-ltafnon | o 29th Oct | 3 | 2 |
Compares | 4 | compa-tjhacxd | o 27th Oct | 1 | 2 |
Compares | 5 | compa-vztxtjc | to 1st Nov | 2 | 4 |
Compares | 6 | compa-momncjm | o 19th Nov | 1 | 1 |
Compares | 7 | compa-cockhyp | o 19th Dec | 4 | 5 |
Compares | 8 | itsac-ihtlze | a compare | 4 | 1 |
Compares | 9 | compa-kycgmav | to 5th Apr | 1 | 2 |
Compares | 10 | compa-kdxjbhh | o 14th Dec | 2 | 4 |
Timelapse | 1 | longp-mvxla | Long Ponds | 1 | 2 |
Timelapse | 2 | basem-hfmjp | Basement Today | 2 | 3 |
Timelapse | 3 | 3pp-cloxd | 3PP | 3 | 4 |
Timelapse | 4 | digit-rgblx | Digital HUb | 4 | 1 |
Timelapse | 5 | demo-jvnzg | Demo | 5 | 2 |
tab_name | tab_id | exid | title | camera_id | requested_by |
---|---|---|---|---|---|
Timelapse | 1 | longp-mvxla | Long Ponds | 1 | 2 |
tab_name | tab_id | exid | title | camera_id | requested_by | lastname | cam_id | name | |
---|---|---|---|---|---|---|---|---|---|
Archives | 1 | concre-r6ys | Concrete P | 1 | 1 | INTOCCIA | fintocci@its.jnj.com | 1 | Sisk Mater 1 |
Archives | 2 | 201809-27xn | 2018-09-26 | 1 | 1 | INTOCCIA | fintocci@its.jnj.com | 1 | Sisk Mater 1 |
Archives | 3 | 201902-htu9 | 2019-02-01 | 4 | 1 | INTOCCIA | fintocci@its.jnj.com | 4 | Normal Test Camera |
Archives | 4 | extrac-png8 | Extract | 5 | 5 | Rahilly | lrahilly@meicltd.com | 5 | Jubilee Phase 2 |
Archives | 5 | joecli-kvpw | joe clip | 2 | 1 | INTOCCIA | fintocci@its.jnj.com | 2 | Stenson Court |
Archives | 6 | joescl-pgfl | Joe's Clip | 3 | 4 | Braham | paul.braham@hse.ie | 3 | DSLR FTP |
Archives | 7 | bartra-bnm5 | Bartra - L | 3 | 1 | INTOCCIA | fintocci@its.jnj.com | 3 | DSLR FTP |
Archives | 8 | joescl-fv4u | Joe's clip | 5 | 4 | Braham | paul.braham@hse.ie | 5 | Jubilee Phase 2 |
Archives | 9 | spark-kyzrq | Sparks Bui | 1 | 1 | INTOCCIA | fintocci@its.jnj.com | 1 | Sisk Mater 1 |
Archives | 10 | 201611-luw8 | 2016-11-06 | 2 | 4 | Braham | paul.braham@hse.ie | 2 | Stenson Court |
Compares | 1 | compa-ylxwctg | o 29th Oct | 1 | 2 | Kirrane | rkirrane@deniswilliams.ie | 1 | Sisk Mater 1 |
Compares | 2 | test-hroqe | test | 2 | 3 | Borowiak | b.borowiak@waterman-moylan.ie | 2 | Stenson Court |
Compares | 3 | compa-ltafnon | o 29th Oct | 3 | 2 | Kirrane | rkirrane@deniswilliams.ie | 3 | DSLR FTP |
Compares | 4 | compa-tjhacxd | o 27th Oct | 1 | 2 | Kirrane | rkirrane@deniswilliams.ie | 1 | Sisk Mater 1 |
Compares | 5 | compa-vztxtjc | to 1st Nov | 2 | 4 | Braham | paul.braham@hse.ie | 2 | Stenson Court |
Compares | 6 | compa-momncjm | o 19th Nov | 1 | 1 | INTOCCIA | fintocci@its.jnj.com | 1 | Sisk Mater 1 |
Compares | 7 | compa-cockhyp | o 19th Dec | 4 | 5 | Rahilly | lrahilly@meicltd.com | 4 | Normal Test Camera |
Compares | 8 | itsac-ihtlze | a compare | 4 | 1 | INTOCCIA | fintocci@its.jnj.com | 4 | Normal Test Camera |
Compares | 9 | compa-kycgmav | to 5th Apr | 1 | 2 | Kirrane | rkirrane@deniswilliams.ie | 1 | Sisk Mater 1 |
Compares | 10 | compa-kdxjbhh | o 14th Dec | 2 | 4 | Braham | paul.braham@hse.ie | 2 | Stenson Court |
Timelapse | 1 | longp-mvxla | Long Ponds | 1 | 2 | Kirrane | rkirrane@deniswilliams.ie | 1 | Sisk Mater 1 |
Timelapse | 2 | basem-hfmjp | Basement Today | 2 | 3 | Borowiak | b.borowiak@waterman-moylan.ie | 2 | Stenson Court |
Timelapse | 3 | 3pp-cloxd | 3PP | 3 | 4 | Braham | paul.braham@hse.ie | 3 | DSLR FTP |
Timelapse | 4 | digit-rgblx | Digital HUb | 4 | 1 | INTOCCIA | fintocci@its.jnj.com | 4 | Normal Test Camera |
Timelapse | 5 | demo-jvnzg | Demo | 5 | 2 | Kirrane | rkirrane@deniswilliams.ie | 5 | Jubilee Phase 2 |
title | exid | status | created_at | requester_email | camera_name |
---|---|---|---|---|---|
2016-11-06 BWLiffeyCruises 1200-1230 | 201611-luw8 | 2 | 2016-11-23 09:36:32+00 | paul.braham@hse.ie | Stenson Court |
Joe's clip | joescl-fv4u | 2 | 2017-04-21 10:25:13+01 | paul.braham@hse.ie | Jubilee Phase 2 |
Long Ponds | longp-mvxla | 3 | 2017-05-18 08:16:13+01 | rkirrane@deniswilliams.ie | Sisk Mater 1 |
3PP | 3pp-cloxd | 3 | 2017-05-18 08:16:12+01 | paul.braham@hse.ie | DSLR FTP |
Its a compare | itsac-ihtlze | 1 | 2020-01-01 08:46:23.172885+00 | fintocci@its.jnj.com | Normal Test Camera |
test | test-hroqe | 1 | 2018-01-17 11:08:19.845168+00 | b.borowiak@waterman-moylan.ie | Stenson Court |
2019-02-01T10:13:47.000Z | 201902-htu9 | 2 | 2019-02-01 10:14:56+00 | fintocci@its.jnj.com | Normal Test Camera |
Digital HUb | digit-rgblx | 3 | 2017-05-18 08:16:10+01 | fintocci@its.jnj.com | Normal Test Camera |
Basement Today | basem-hfmjp | 6 | 2019-01-22 11:49:46.333172+00 | b.borowiak@waterman-moylan.ie | Stenson Court |
Joe's Clip | joescl-pgfl | 2 | 2017-04-21 10:23:47+01 | paul.braham@hse.ie | DSLR FTP |
Bartra - Loughshinny Time-lapse, October 2018 | bartra-bnm5 | 2 | 2018-10-15 14:49:51.783621+01 | fintocci@its.jnj.com | DSLR FTP |
Compare: 4th Dec to 14th Dec | compa-kdxjbhh | 1 | 2018-12-14 22:25:00.735079+00 | paul.braham@hse.ie | Stenson Court |
Extract | extrac-png8 | 2 | 2017-04-18 09:50:42+01 | lrahilly@meicltd.com | Jubilee Phase 2 |
joe clip | joecli-kvpw | 2 | 2017-04-20 00:02:35+01 | fintocci@its.jnj.com | Stenson Court |
Compare: 11th Jan to 19th Dec | compa-cockhyp | 1 | 2018-12-19 14:13:35.856163+00 | lrahilly@meicltd.com | Normal Test Camera |
Demo | demo-jvnzg | 3 | 2017-05-18 08:16:10+01 | rkirrane@deniswilliams.ie | Jubilee Phase 2 |
Compare: 18th Jul to 1st Nov | compa-vztxtjc | 1 | 2018-11-15 10:03:24.85408+00 | paul.braham@hse.ie | Stenson Court |
2018-09-26T10:00:04.000Z | 201809-27xn | 2 | 2018-11-27 16:05:01.813853+00 | fintocci@its.jnj.com | Sisk Mater 1 |
Concrete Pour | concre-r6ys | 2 | 2017-04-05 15:46:38+01 | fintocci@its.jnj.com | Sisk Mater 1 |
Compare: 1st Nov to 5th Apr | compa-kycgmav | 1 | 2019-04-08 14:54:03.809314+01 | rkirrane@deniswilliams.ie | Sisk Mater 1 |
Compare: 11th Oct to 19th Nov | compa-momncjm | 1 | 2018-11-19 15:28:52.359459+00 | fintocci@its.jnj.com | Sisk Mater 1 |
Compare: 26th Jul to 29th Oct | compa-ltafnon | 1 | 2018-10-29 05:53:39.989565+00 | rkirrane@deniswilliams.ie | DSLR FTP |
Compare: 23rd Jan to 27th Oct | compa-tjhacxd | 1 | 2018-10-29 05:56:52.67979+00 | rkirrane@deniswilliams.ie | Sisk Mater 1 |
Sparks Building, Newcastle - Time-lapse, July 2020 | spark-kyzrq | 2 | 2020-07-28 16:25:33.449623+01 | fintocci@its.jnj.com | Sisk Mater 1 |
Compare: 8th Sep to 29th Oct | compa-ylxwctg | 1 | 2018-10-29 05:52:09.659566+00 | rkirrane@deniswilliams.ie | Sisk Mater 1 |
QUERY PLAN |
---|
Append (cost=0.00..33.48 rows=130 width=108) (actual time=0.013..0.045 rows=25 loops=1) |
Buffers: shared hit=3 |
-> Seq Scan on archives a (cost=0.00..10.50 rows=40 width=108) (actual time=0.012..0.016 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Subquery Scan on "*SELECT* 2" (cost=0.00..11.12 rows=50 width=108) (actual time=0.008..0.014 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Seq Scan on compares c (cost=0.00..10.62 rows=50 width=592) (actual time=0.007..0.012 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Subquery Scan on "*SELECT* 3" (cost=0.00..10.80 rows=40 width=108) (actual time=0.007..0.009 rows=5 loops=1) |
Buffers: shared hit=1 |
-> Seq Scan on timelapses t (cost=0.00..10.40 rows=40 width=1076) (actual time=0.006..0.008 rows=5 loops=1) |
Buffers: shared hit=1 |
Planning Time: 0.255 ms |
Execution Time: 0.086 ms |
QUERY PLAN |
---|
HashAggregate (cost=105.81..107.11 rows=130 width=140) (actual time=0.554..0.565 rows=25 loops=1) |
Group Key: ar.title, ar.exid, ar.status, ar.created_at, u.email, c.name |
Buffers: shared hit=9 |
-> Append (cost=22.02..103.86 rows=130 width=140) (actual time=0.084..0.534 rows=25 loops=1) |
Buffers: shared hit=9 |
-> Hash Left Join (cost=22.02..33.78 rows=40 width=140) (actual time=0.083..0.223 rows=10 loops=1) |
Hash Cond: (ar.requested_by = u.id) |
Buffers: shared hit=3 |
-> Hash Right Join (cost=10.90..22.54 rows=40 width=112) (actual time=0.048..0.183 rows=10 loops=1) |
Hash Cond: (c.id = ar.camera_id) |
Buffers: shared hit=2 |
-> Seq Scan on cameras c (cost=0.00..10.90 rows=90 width=36) (actual time=0.006..0.009 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Hash (cost=10.40..10.40 rows=40 width=84) (actual time=0.025..0.025 rows=10 loops=1) |
Buckets: 1024 Batches: 1 Memory Usage: 9kB |
Buffers: shared hit=1 |
-> Seq Scan on archives ar (cost=0.00..10.40 rows=40 width=84) (actual time=0.011..0.014 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Hash (cost=10.50..10.50 rows=50 width=36) (actual time=0.019..0.019 rows=10 loops=1) |
Buckets: 1024 Batches: 1 Memory Usage: 9kB |
Buffers: shared hit=1 |
-> Seq Scan on users u (cost=0.00..10.50 rows=50 width=36) (actual time=0.007..0.010 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Subquery Scan on "*SELECT* 2" (cost=22.02..34.28 rows=40 width=140) (actual time=0.191..0.203 rows=5 loops=1) |
Buffers: shared hit=3 |
-> Hash Left Join (cost=22.02..33.78 rows=40 width=1108) (actual time=0.189..0.198 rows=5 loops=1) |
Hash Cond: (tl.user_id = u_1.id) |
Buffers: shared hit=3 |
-> Hash Right Join (cost=10.90..22.54 rows=40 width=1080) (actual time=0.150..0.157 rows=5 loops=1) |
Hash Cond: (c_1.id = tl.camera_id) |
Buffers: shared hit=2 |
-> Seq Scan on cameras c_1 (cost=0.00..10.90 rows=90 width=36) (actual time=0.009..0.010 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Hash (cost=10.40..10.40 rows=40 width=1052) (actual time=0.115..0.115 rows=5 loops=1) |
Buckets: 1024 Batches: 1 Memory Usage: 9kB |
Buffers: shared hit=1 |
-> Seq Scan on timelapses tl (cost=0.00..10.40 rows=40 width=1052) (actual time=0.010..0.015 rows=5 loops=1) |
Buffers: shared hit=1 |
-> Hash (cost=10.50..10.50 rows=50 width=36) (actual time=0.018..0.019 rows=10 loops=1) |
Buckets: 1024 Batches: 1 Memory Usage: 9kB |
Buffers: shared hit=1 |
-> Seq Scan on users u_1 (cost=0.00..10.50 rows=50 width=36) (actual time=0.007..0.010 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Subquery Scan on "*SELECT* 3" (cost=22.25..34.75 rows=50 width=140) (actual time=0.088..0.103 rows=10 loops=1) |
Buffers: shared hit=3 |
-> Hash Left Join (cost=22.25..34.13 rows=50 width=1108) (actual time=0.086..0.098 rows=10 loops=1) |
Hash Cond: (cm.requested_by = u_2.id) |
Buffers: shared hit=3 |
-> Hash Right Join (cost=11.12..22.86 rows=50 width=1080) (actual time=0.051..0.060 rows=10 loops=1) |
Hash Cond: (c_2.id = cm.camera_id) |
Buffers: shared hit=2 |
-> Seq Scan on cameras c_2 (cost=0.00..10.90 rows=90 width=36) (actual time=0.006..0.007 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Hash (cost=10.50..10.50 rows=50 width=1052) (actual time=0.020..0.021 rows=10 loops=1) |
Buckets: 1024 Batches: 1 Memory Usage: 9kB |
Buffers: shared hit=1 |
-> Seq Scan on compares cm (cost=0.00..10.50 rows=50 width=1052) (actual time=0.008..0.011 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Hash (cost=10.50..10.50 rows=50 width=36) (actual time=0.018..0.018 rows=10 loops=1) |
Buckets: 1024 Batches: 1 Memory Usage: 9kB |
Buffers: shared hit=1 |
-> Seq Scan on users u_2 (cost=0.00..10.50 rows=50 width=36) (actual time=0.007..0.009 rows=10 loops=1) |
Buffers: shared hit=1 |
Planning Time: 0.800 ms |
Execution Time: 0.643 ms |
QUERY PLAN |
---|
Hash Join (cost=23.15..58.41 rows=35 width=208) (actual time=0.064..0.115 rows=25 loops=1) |
Hash Cond: (a.camera_id = cam.id) |
Buffers: shared hit=5 |
-> Hash Join (cost=11.12..46.25 rows=50 width=172) (actual time=0.033..0.075 rows=25 loops=1) |
Hash Cond: (a.requested_by = u.id) |
Buffers: shared hit=4 |
-> Append (cost=0.00..33.48 rows=130 width=108) (actual time=0.008..0.042 rows=25 loops=1) |
Buffers: shared hit=3 |
-> Seq Scan on archives a (cost=0.00..10.50 rows=40 width=108) (actual time=0.008..0.013 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Subquery Scan on "*SELECT* 2" (cost=0.00..11.12 rows=50 width=108) (actual time=0.008..0.015 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Seq Scan on compares c (cost=0.00..10.62 rows=50 width=592) (actual time=0.008..0.012 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Subquery Scan on "*SELECT* 3" (cost=0.00..10.80 rows=40 width=108) (actual time=0.007..0.009 rows=5 loops=1) |
Buffers: shared hit=1 |
-> Seq Scan on timelapses t (cost=0.00..10.40 rows=40 width=1076) (actual time=0.006..0.008 rows=5 loops=1) |
Buffers: shared hit=1 |
-> Hash (cost=10.50..10.50 rows=50 width=68) (actual time=0.019..0.019 rows=10 loops=1) |
Buckets: 1024 Batches: 1 Memory Usage: 9kB |
Buffers: shared hit=1 |
-> Seq Scan on users u (cost=0.00..10.50 rows=50 width=68) (actual time=0.013..0.015 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Hash (cost=10.90..10.90 rows=90 width=36) (actual time=0.018..0.018 rows=10 loops=1) |
Buckets: 1024 Batches: 1 Memory Usage: 9kB |
Buffers: shared hit=1 |
-> Seq Scan on cameras cam (cost=0.00..10.90 rows=90 width=36) (actual time=0.011..0.013 rows=10 loops=1) |
Buffers: shared hit=1 |
Planning Time: 0.598 ms |
Execution Time: 0.205 ms |
QUERY PLAN |
---|
Subquery Scan on core (cost=0.00..35.10 rows=1 width=108) (actual time=0.065..0.070 rows=1 loops=1) |
Filter: (core.title ~~ '%Pond%'::text) |
Rows Removed by Filter: 24 |
Buffers: shared hit=3 |
-> Append (cost=0.00..33.48 rows=130 width=108) (actual time=0.012..0.063 rows=25 loops=1) |
Buffers: shared hit=3 |
-> Seq Scan on archives a (cost=0.00..10.50 rows=40 width=108) (actual time=0.012..0.016 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Subquery Scan on "*SELECT* 2" (cost=0.00..11.12 rows=50 width=108) (actual time=0.008..0.014 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Seq Scan on compares c (cost=0.00..10.62 rows=50 width=592) (actual time=0.007..0.011 rows=10 loops=1) |
Buffers: shared hit=1 |
-> Subquery Scan on "*SELECT* 3" (cost=0.00..10.80 rows=40 width=108) (actual time=0.026..0.029 rows=5 loops=1) |
Buffers: shared hit=1 |
-> Seq Scan on timelapses t (cost=0.00..10.40 rows=40 width=1076) (actual time=0.026..0.027 rows=5 loops=1) |
Buffers: shared hit=1 |
Planning Time: 0.170 ms |
Execution Time: 0.094 ms |