explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sGOR : Optimization for: exists; plan #e11u

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 3.603 132.666 ↑ 1.8 1,652 1

Nested Loop Semi Join (cost=250.38..63,676.19 rows=3,016 width=47) (actual time=19.168..132.666 rows=1,652 loops=1)

2. 3.361 117.499 ↑ 20.6 1,652 1

Nested Loop (cost=249.95..32,902.07 rows=33,964 width=55) (actual time=19.140..117.499 rows=1,652 loops=1)

3. 1.679 97.718 ↓ 1.1 821 1

Nested Loop (cost=249.51..7,119.20 rows=779 width=47) (actual time=18.651..97.718 rows=821 loops=1)

4. 4.638 19.686 ↓ 1.1 821 1

Hash Join (cost=249.08..1,407.99 rows=779 width=39) (actual time=17.083..19.686 rows=821 loops=1)

  • Hash Cond: (auditpacka0_.audit_package_id = auditpacka2_.id)
5. 6.276 14.362 ↑ 1.0 6,486 1

Bitmap Heap Scan on audit_package_item auditpacka0_ (cost=241.27..1,367.93 rows=6,522 width=39) (actual time=8.394..14.362 rows=6,486 loops=1)

  • Recheck Cond: (audit_package_id = ANY ('{587272,585865,587371,587373,587375,583713,587364,585894,585912,585880,581694,585694,582704,584692,585909,587351}'::bigint[]))
  • Heap Blocks: exact=62
6. 8.086 8.086 ↑ 1.0 6,486 1

Bitmap Index Scan on audit_package_item_audit_package_id_ix (cost=0.00..239.64 rows=6,522 width=0) (actual time=8.086..8.086 rows=6,486 loops=1)

  • Index Cond: (audit_package_id = ANY ('{587272,585865,587371,587373,587375,583713,587364,585894,585912,585880,581694,585694,582704,584692,585909,587351}'::bigint[]))
7. 0.066 0.686 ↓ 1.2 30 1

Hash (cost=7.51..7.51 rows=24 width=8) (actual time=0.686..0.686 rows=30 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
8. 0.620 0.620 ↓ 1.2 30 1

Seq Scan on audit_package auditpacka2_ (cost=0.00..7.51 rows=24 width=8) (actual time=0.045..0.620 rows=30 loops=1)

  • Filter: ((shared_type)::text = 'SHARED'::text)
  • Rows Removed by Filter: 181
9. 76.353 76.353 ↑ 1.0 1 821

Index Scan using line_pkey on line line1_ (cost=0.43..7.32 rows=1 width=16) (actual time=0.091..0.093 rows=1 loops=821)

  • Index Cond: (id = auditpacka0_.line_id)
10. 16.420 16.420 ↑ 6.5 2 821

Index Scan using bill_item_audit_audit_package_item_id_ix on bill_item_audit billitemsa3_ (cost=0.43..32.97 rows=13 width=8) (actual time=0.014..0.020 rows=2 loops=821)

  • Index Cond: (audit_package_item_id = auditpacka0_.id)
  • Filter: (subscription_id = ANY ('{158498,12096,158499,158496,158497,111433,111434,400,157526,157524,157525,12094,350}'::bigint[]))
11. 11.564 11.564 ↑ 16.0 1 1,652

Index Only Scan using bill_item_audit_audit_package_item_id_ix on bill_item_audit bia (cost=0.43..7.46 rows=16 width=8) (actual time=0.007..0.007 rows=1 loops=1,652)

  • Index Cond: (audit_package_item_id = auditpacka0_.id)
  • Heap Fetches: 0