explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VN6C

Settings
# exclusive inclusive rows x rows loops node
1. 43.639 254.624 ↑ 1.0 1 1

Aggregate (cost=162,366.84..162,366.85 rows=1 width=72) (actual time=254.624..254.624 rows=1 loops=1)

2. 19.354 210.985 ↓ 8.5 69,021 1

Hash Join (cost=1,269.81..162,021.23 rows=8,132 width=17) (actual time=6.774..210.985 rows=69,021 loops=1)

  • Hash Cond: (api_rule.category_id = api_rulecategory.id)
3. 40.439 191.623 ↓ 8.5 69,021 1

Hash Join (cost=1,268.72..161,976.17 rows=8,132 width=10) (actual time=6.761..191.623 rows=69,021 loops=1)

  • Hash Cond: (api_currentreport.rule_id = api_rule.id)
4. 27.994 150.262 ↓ 20.5 208,925 1

Merge Anti Join (cost=1,032.23..161,712.84 rows=10,193 width=4) (actual time=5.830..150.262 rows=208,925 loops=1)

  • Merge Cond: (api_currentreport.system_uuid = u0.system_uuid)
  • Join Filter: (u0.rule_id = api_currentreport.rule_id)
5. 41.863 122.224 ↓ 20.5 208,925 1

Gather Merge (cost=1,025.54..161,680.64 rows=10,193 width=20) (actual time=5.783..122.224 rows=208,925 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 13.888 80.361 ↓ 16.4 69,642 3 / 3

Nested Loop (cost=25.51..159,504.09 rows=4,247 width=20) (actual time=0.355..80.361 rows=69,642 loops=3)

7. 8.120 8.120 ↓ 2.1 6,484 3 / 3

Parallel Index Only Scan using api_host_account_system_uuid_stale_warn_at_index on api_host (cost=0.43..1,266.10 rows=3,028 width=16) (actual time=0.027..8.120 rows=6,484 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: 3167
8. 58.137 58.353 ↑ 3.5 11 19,451 / 3

Index Only Scan using curreport_system_uuid_rule_id on api_currentreport (cost=25.09..51.88 rows=38 width=20) (actual time=0.005..0.009 rows=11 loops=19,451)

  • Index Cond: (system_uuid = api_host.system_uuid)
  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 1
  • Heap Fetches: 9433
9.          

SubPlan (for Index Only Scan)

10. 0.216 0.216 ↑ 1.0 351 3 / 3

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

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 741
11. 0.013 0.044 ↓ 0.0 0 1

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

  • Sort Key: u0.system_uuid
  • Sort Method: quicksort Memory: 25kB
12. 0.031 0.031 ↓ 0.0 0 1

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

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 215
13. 0.124 0.922 ↑ 1.0 1,018 1

Hash (cost=223.76..223.76 rows=1,018 width=10) (actual time=0.922..0.922 rows=1,018 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 52kB
14. 0.798 0.798 ↑ 1.0 1,018 1

Seq Scan on api_rule (cost=0.00..223.76 rows=1,018 width=10) (actual time=0.005..0.798 rows=1,018 loops=1)

  • Filter: active
  • Rows Removed by Filter: 258
15. 0.003 0.008 ↑ 1.0 4 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
16. 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.005..0.005 rows=4 loops=1)

Planning time : 1.075 ms
Execution time : 254.778 ms