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?.
QUERY PLAN |
---|
Hash Join (cost=114.85..160.97 rows=18 width=244) (actual time=0.006..0.008 rows=0 loops=1) |
Hash Cond: ((t3.cid_hash)::text = (t2.cid_hash)::text) |
Join Filter: ((((t3.acct)::text = 'I'::text) AND ((t3.acct_sub)::text = ANY ('{4,5}'::text[]))) OR (t2.ban = ANY ('{00,01,02,03,04,05}'::bpchar[])) OR (((t4.soc)::text = 'NFWJYW0'::text) AND ((t4.curr_ind)::text = 'Y'::text))) |
-> Seq Scan on acc t3 (cost=0.00..14.20 rows=420 width=164) (actual time=0.005..0.006 rows=0 loops=1) |
-> Hash (cost=111.35..111.35 rows=280 width=302) (never executed) |
-> Merge Left Join (cost=103.35..111.35 rows=280 width=302) (never executed) |
Merge Cond: (((t2.cid_hash)::text = (t4.cid_hash)::text) AND ((t2.accs_mthd)::text = (t4.accs_mthd)::text)) |
-> Sort (cost=24.18..24.88 rows=280 width=256) (never executed) |
Sort Key: t2.cid_hash, t2.accs_mthd |
-> Seq Scan on sub t2 (cost=0.00..12.80 rows=280 width=256) (never executed) |
-> Sort (cost=79.17..81.12 rows=780 width=282) (never executed) |
Sort Key: t4.cid_hash, t4.accs_mthd |
-> Append (cost=0.00..41.70 rows=780 width=282) (never executed) |
-> Seq Scan on sub_soc1 t4 (cost=0.00..12.60 rows=260 width=282) (never executed) |
-> Seq Scan on sub_soc2 t4_1 (cost=0.00..12.60 rows=260 width=282) (never executed) |
-> Seq Scan on sub_soc3 t4_2 (cost=0.00..12.60 rows=260 width=282) (never executed) |
Planning Time: 1.496 ms |
Execution Time: 0.139 ms |