explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9NcB

Settings
# exclusive inclusive rows x rows loops node
1. 44.722 259.052 ↑ 1.0 1 1

Aggregate (cost=266,296.32..266,296.33 rows=1 width=72) (actual time=259.052..259.052 rows=1 loops=1)

2. 15.350 214.330 ↓ 9.1 68,911 1

Hash Anti Join (cost=1,269.87..265,975.62 rows=7,546 width=17) (actual time=1.543..214.330 rows=68,911 loops=1)

  • Hash Cond: ((api_currentreport.rule_id = u0.rule_id) AND (api_currentreport.system_uuid = u0.system_uuid))
3. 19.962 198.941 ↓ 9.1 68,911 1

Hash Join (cost=1,263.14..265,853.81 rows=7,546 width=33) (actual time=1.492..198.941 rows=68,911 loops=1)

  • Hash Cond: (api_rule.category_id = api_rulecategory.id)
4. 38.345 178.971 ↓ 9.1 68,911 1

Hash Join (cost=1,262.05..265,811.93 rows=7,546 width=26) (actual time=1.479..178.971 rows=68,911 loops=1)

  • Hash Cond: (api_currentreport.rule_id = api_rule.id)
5. 0.000 139.722 ↓ 21.9 208,787 1

Gather (cost=1,025.64..265,550.47 rows=9,514 width=20) (actual time=0.569..139.722 rows=208,787 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
6. 19.964 148.249 ↓ 18.7 104,394 2 / 2

Nested Loop (cost=25.64..263,599.07 rows=5,596 width=20) (actual time=0.299..148.249 rows=104,394 loops=2)

7. 11.591 11.591 ↓ 2.5 9,724 2 / 2

Parallel Index Only Scan using api_host_account_stale_warn_at_system_uuid_index on api_host (cost=0.55..507.48 rows=3,966 width=16) (actual time=0.016..11.591 rows=9,724 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: 5619
8. 116.509 116.694 ↑ 3.4 11 19,449 / 2

Index Only Scan using curreport_system_uuid_rule_id on api_currentreport (cost=25.09..65.97 rows=37 width=20) (actual time=0.006..0.012 rows=11 loops=19,449)

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

SubPlan (for Index Only Scan)

10. 0.185 0.185 ↑ 1.0 351 2 / 2

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

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 741
11. 0.116 0.904 ↑ 1.0 1,012 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 52kB
12. 0.788 0.788 ↑ 1.0 1,012 1

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

  • Filter: active
  • Rows Removed by Filter: 264
13. 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
14. 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)

15. 0.001 0.039 ↓ 0.0 0 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
16. 0.038 0.038 ↓ 0.0 0 1

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

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