explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AxkX

Settings
# exclusive inclusive rows x rows loops node
1. 48.497 770.911 ↑ 1.0 1 1

Aggregate (cost=74,183.25..74,183.26 rows=1 width=72) (actual time=770.911..770.911 rows=1 loops=1)

2. 20.687 722.414 ↓ 8.2 68,847 1

Hash Anti Join (cost=1,696.03..73,826.72 rows=8,389 width=17) (actual time=11.636..722.414 rows=68,847 loops=1)

  • Hash Cond: ((api_currentreport.rule_id = u0.rule_id) AND (api_currentreport.system_uuid = u0.system_uuid))
3. 21.292 701.685 ↓ 8.2 68,847 1

Hash Join (cost=1,689.30..73,692.06 rows=8,389 width=33) (actual time=11.583..701.685 rows=68,847 loops=1)

  • Hash Cond: (api_rule.category_id = api_rulecategory.id)
4. 44.788 680.386 ↓ 8.2 68,847 1

Hash Join (cost=1,688.21..73,645.62 rows=8,389 width=26) (actual time=11.571..680.386 rows=68,847 loops=1)

  • Hash Cond: (api_currentreport.rule_id = api_rule.id)
5. 0.000 634.825 ↓ 19.7 208,653 1

Gather (cost=1,460.80..73,390.35 rows=10,578 width=20) (actual time=10.795..634.825 rows=208,653 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 228.195 683.099 ↓ 15.8 69,551 3 / 3

Hash Join (cost=460.80..71,332.55 rows=4,408 width=20) (actual time=11.647..683.099 rows=69,551 loops=3)

  • Hash Cond: (api_currentreport.system_uuid = api_host.system_uuid)
7. 443.659 443.856 ↓ 1.5 1,480,203 3 / 3

Parallel Seq Scan on api_currentreport (cost=24.53..68,329.73 rows=977,728 width=20) (actual time=0.335..443.856 rows=1,480,203 loops=3)

  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 84177
8.          

SubPlan (for Parallel Seq Scan)

9. 0.197 0.197 ↑ 1.0 351 3 / 3

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

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 741
10. 4.811 11.048 ↓ 2.5 19,445 3 / 3

Hash (cost=340.95..340.95 rows=7,626 width=16) (actual time=11.048..11.048 rows=19,445 loops=3)

  • Buckets: 32768 (originally 8192) Batches: 1 (originally 1) Memory Usage: 1168kB
11. 6.237 6.237 ↓ 2.5 19,445 3 / 3

Index Only Scan using api_host_account_stale_warn_at_system_uuid_index on api_host (cost=0.43..340.95 rows=7,626 width=16) (actual time=0.075..6.237 rows=19,445 loops=3)

  • Index Cond: ((account = '729650'::text) AND (stale_warn_at > '2020-05-16 16:16:47.586377+00'::timestamp with time zone))
  • Heap Fetches: 0
12. 0.182 0.773 ↑ 1.0 1,012 1

Hash (cost=214.76..214.76 rows=1,012 width=10) (actual time=0.773..0.773 rows=1,012 loops=1)

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

Seq Scan on api_rule (cost=0.00..214.76 rows=1,012 width=10) (actual time=0.004..0.591 rows=1,012 loops=1)

  • Filter: active
  • Rows Removed by Filter: 264
14. 0.002 0.007 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=15) (actual time=0.007..0.007 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.005 0.005 ↑ 1.0 4 1

Seq Scan on api_rulecategory (cost=0.00..1.04 rows=4 width=15) (actual time=0.004..0.005 rows=4 loops=1)

16. 0.001 0.042 ↓ 0.0 0 1

Hash (cost=6.70..6.70 rows=2 width=20) (actual time=0.042..0.042 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
17. 0.041 0.041 ↓ 0.0 0 1

Seq Scan on api_hostack u0 (cost=0.00..6.70 rows=2 width=20) (actual time=0.041..0.041 rows=0 loops=1)

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 216
Planning time : 1.322 ms
Execution time : 771.069 ms