explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0sd

Settings
# exclusive inclusive rows x rows loops node
1. 34.159 175.304 ↑ 1.0 1 1

Aggregate (cost=22,499.94..22,499.95 rows=1 width=8) (actual time=175.303..175.304 rows=1 loops=1)

2. 9.821 141.145 ↓ 5.8 69,129 1

Gather (cost=1,281.59..22,470.10 rows=11,934 width=16) (actual time=1.615..141.145 rows=69,129 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
3. 25.389 131.324 ↓ 4.9 34,564 2 / 2

Hash Join (cost=281.59..20,276.70 rows=7,020 width=16) (actual time=1.840..131.324 rows=34,564 loops=2)

  • Hash Cond: (api_currentreport.rule_id = api_rule.id)
4. 22.173 104.314 ↓ 9.3 113,064 2 / 2

Merge Anti Join (cost=7.56..19,886.95 rows=12,144 width=20) (actual time=0.128..104.314 rows=113,064 loops=2)

  • Merge Cond: (api_currentreport.system_uuid = u0.system_uuid)
  • Join Filter: (u0.rule_id = api_currentreport.rule_id)
5. 29.408 82.077 ↓ 9.3 113,064 2 / 2

Nested Loop (cost=0.86..19,849.87 rows=12,144 width=20) (actual time=0.062..82.077 rows=113,064 loops=2)

6. 4.034 4.034 ↓ 2.2 9,727 2 / 2

Parallel Index Only Scan using api_host_account_system_uuid_stale_warn_at_index on api_host (cost=0.43..1,019.93 rows=4,346 width=16) (actual time=0.038..4.034 rows=9,727 loops=2)

  • Index Cond: ((account = '729650'::text) AND (stale_warn_at > '2020-05-16 16:16:47.586377+00'::timestamp with time zone))
  • Heap Fetches: 0
7. 48.635 48.635 ↑ 1.3 12 19,454 / 2

Index Only Scan using curreport_system_uuid_rule_id on api_currentreport (cost=0.43..4.17 rows=16 width=20) (actual time=0.004..0.005 rows=12 loops=19,454)

  • Index Cond: (system_uuid = api_host.system_uuid)
  • Heap Fetches: 0
8. 0.016 0.064 ↓ 0.0 0 2 / 2

Sort (cost=6.70..6.70 rows=2 width=20) (actual time=0.064..0.064 rows=0 loops=2)

  • Sort Key: u0.system_uuid
  • Sort Method: quicksort Memory: 25kB
9. 0.048 0.048 ↓ 0.0 0 2 / 2

Seq Scan on api_hostack u0 (cost=0.00..6.69 rows=2 width=20) (actual time=0.048..0.048 rows=0 loops=2)

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 215
10. 0.188 1.621 ↑ 1.1 696 2 / 2

Hash (cost=264.81..264.81 rows=738 width=4) (actual time=1.621..1.621 rows=696 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 33kB
11. 0.299 1.433 ↑ 1.1 696 2 / 2

Hash Anti Join (cost=28.18..264.81 rows=738 width=4) (actual time=0.343..1.433 rows=696 loops=2)

  • Hash Cond: (api_rule.id = api_ack.rule_id)
12. 0.813 0.813 ↑ 1.0 1,018 2 / 2

Seq Scan on api_rule (cost=0.00..215.77 rows=1,018 width=4) (actual time=0.013..0.813 rows=1,018 loops=2)

  • Filter: active
  • Rows Removed by Filter: 259
13. 0.086 0.321 ↑ 1.0 351 2 / 2

Hash (cost=23.79..23.79 rows=351 width=4) (actual time=0.321..0.321 rows=351 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
14. 0.235 0.235 ↑ 1.0 351 2 / 2

Seq Scan on api_ack (cost=0.00..23.79 rows=351 width=4) (actual time=0.015..0.235 rows=351 loops=2)

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 752
Planning time : 1.395 ms
Execution time : 175.423 ms