explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oIa

Settings
# exclusive inclusive rows x rows loops node
1. 107.608 347.569 ↑ 1.0 1 1

Aggregate (cost=71,696.38..71,696.39 rows=1 width=72) (actual time=347.569..347.569 rows=1 loops=1)

2. 0.000 239.961 ↓ 2.9 68,911 1

Gather (cost=1,263.28..70,685.17 rows=23,793 width=29) (actual time=11.931..239.961 rows=68,911 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 13.521 256.663 ↓ 2.3 22,970 3 / 3

Hash Join (cost=263.28..67,305.87 rows=9,914 width=29) (actual time=7.559..256.663 rows=22,970 loops=3)

  • Hash Cond: (api_rule.category_id = api_rulecategory.id)
4. 13.639 243.127 ↓ 2.3 22,970 3 / 3

Nested Loop (cost=262.19..67,251.19 rows=9,914 width=22) (actual time=7.525..243.127 rows=22,970 loops=3)

5. 16.674 113.561 ↑ 1.7 23,185 3 / 3

Hash Join (cost=261.76..15,664.50 rows=39,157 width=22) (actual time=7.490..113.561 rows=23,185 loops=3)

  • Hash Cond: (api_currentreport.rule_id = api_rule.id)
6. 15.208 94.182 ↓ 1.4 70,363 3 / 3

Merge Anti Join (cost=25.36..15,298.06 rows=49,372 width=20) (actual time=0.365..94.182 rows=70,363 loops=3)

  • Merge Cond: (api_currentreport.rule_id = u0.rule_id)
  • Join Filter: (u0.system_uuid = api_currentreport.system_uuid)
7. 78.732 78.951 ↓ 1.4 70,363 3 / 3

Parallel Index Only Scan using api_currentreport_account_rule_id_system_uuid_f48d4524_uniq on api_currentreport (cost=25.09..15,115.08 rows=49,372 width=20) (actual time=0.340..78.951 rows=70,363 loops=3)

  • Index Cond: (account = '729650'::text)
  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 5751
  • Heap Fetches: 376
8.          

SubPlan (for Parallel Index Only Scan)

9. 0.219 0.219 ↑ 1.0 351 3 / 3

Seq Scan on api_ack u2 (cost=0.00..23.65 rows=351 width=4) (actual time=0.009..0.219 rows=351 loops=3)

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 741
10. 0.003 0.023 ↓ 0.0 0 3 / 3

Materialize (cost=0.27..17.91 rows=2 width=20) (actual time=0.023..0.023 rows=0 loops=3)

11. 0.020 0.020 ↓ 0.0 0 3 / 3

Index Only Scan using api_hostack_rule_id_account_system_uuid_uindex on api_hostack u0 (cost=0.27..17.91 rows=2 width=20) (actual time=0.020..0.020 rows=0 loops=3)

  • Index Cond: (account = '729650'::text)
  • Heap Fetches: 0
12. 0.259 2.705 ↑ 1.0 1,012 3 / 3

Hash (cost=223.76..223.76 rows=1,012 width=10) (actual time=2.705..2.705 rows=1,012 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 52kB
13. 2.446 2.446 ↑ 1.0 1,012 3 / 3

Seq Scan on api_rule (cost=0.00..223.76 rows=1,012 width=10) (actual time=0.010..2.446 rows=1,012 loops=3)

  • Filter: active
  • Rows Removed by Filter: 264
14. 115.927 115.927 ↑ 1.0 1 69,556 / 3

Index Only Scan using host_system_uuid_stale_warn_at on api_host (cost=0.43..1.32 rows=1 width=16) (actual time=0.005..0.005 rows=1 loops=69,556)

  • Index Cond: ((system_uuid = api_currentreport.system_uuid) AND (stale_warn_at > '2020-05-16 16:15:44.120677+00'::timestamp with time zone))
  • Heap Fetches: 533
15. 0.004 0.015 ↑ 1.0 4 3 / 3

Hash (cost=1.04..1.04 rows=4 width=15) (actual time=0.015..0.015 rows=4 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
16. 0.011 0.011 ↑ 1.0 4 3 / 3

Seq Scan on api_rulecategory (cost=0.00..1.04 rows=4 width=15) (actual time=0.009..0.011 rows=4 loops=3)

Planning time : 1.193 ms
Execution time : 347.747 ms