explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7d9d

Settings
# exclusive inclusive rows x rows loops node
1. 0.064 157.364 ↑ 1.0 13 1

Index Scan using api_ruletopic_name_key on api_ruletopic (cost=0.14..213,619.68 rows=13 width=162) (actual time=0.178..157.364 rows=13 loops=1)

  • Filter: enabled
2.          

SubPlan (for Index Scan)

3. 7.033 157.300 ↑ 1.0 1 13

Aggregate (cost=16,431.32..16,431.33 rows=1 width=8) (actual time=12.099..12.100 rows=1 loops=13)

4. 5.096 150.267 ↓ 10.6 1,847 13

Nested Loop Anti Join (cost=731.07..16,430.89 rows=174 width=16) (actual time=0.263..11.559 rows=1,847 loops=13)

  • Join Filter: ((u0.rule_id = v0.rule_id) AND (u0.system_uuid = v0.system_uuid))
5. 16.946 145.171 ↓ 10.6 1,847 13

Nested Loop (cost=730.80..16,419.55 rows=174 width=20) (actual time=0.262..11.167 rows=1,847 loops=13)

6. 2.218 55.250 ↓ 2.1 1,871 13

Nested Loop (cost=730.37..15,466.65 rows=907 width=20) (actual time=0.251..4.250 rows=1,871 loops=13)

7. 0.216 1.144 ↓ 3.1 43 13

Nested Loop (cost=4.67..57.13 rows=14 width=8) (actual time=0.017..0.088 rows=43 loops=13)

8. 0.260 0.364 ↓ 3.1 43 13

Bitmap Heap Scan on api_rule_tags v3 (cost=4.39..29.00 rows=14 width=4) (actual time=0.011..0.028 rows=43 loops=13)

  • Recheck Cond: (tag_id = api_ruletopic.tag_id)
  • Heap Blocks: exact=108
9. 0.104 0.104 ↓ 3.1 43 13

Bitmap Index Scan on api_rule_tags_tag_id_72c43fbe (cost=0.00..4.39 rows=14 width=0) (actual time=0.008..0.008 rows=43 loops=13)

  • Index Cond: (tag_id = api_ruletopic.tag_id)
10. 0.564 0.564 ↑ 1.0 1 564

Index Only Scan using api_rule_pkey on api_rule v2 (cost=0.28..2.01 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=564)

  • Index Cond: (id = v3.rule_id)
  • Heap Fetches: 0
11. 50.685 51.888 ↑ 5.6 43 564

Index Only Scan using api_currentreport_account_rule_id_system_uuid_f48d4524_uniq on api_currentreport v0 (cost=725.70..1,098.27 rows=241 width=20) (actual time=0.052..0.092 rows=43 loops=564)

  • Index Cond: ((account = '729650'::text) AND (rule_id = v2.id))
  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 64
  • Heap Fetches: 30,739
12.          

SubPlan (for Index Only Scan)

13. 0.314 1.203 ↑ 1.1 663 1

HashAggregate (cost=715.97..723.31 rows=734 width=4) (actual time=1.102..1.203 rows=663 loops=1)

  • Group Key: api_rule.id
14. 0.078 0.889 ↑ 1.0 734 1

Append (cost=0.00..714.13 rows=734 width=4) (actual time=0.004..0.889 rows=734 loops=1)

15. 0.671 0.671 ↑ 1.0 381 1

Seq Scan on api_rule (cost=0.00..250.09 rows=381 width=4) (actual time=0.003..0.671 rows=381 loops=1)

  • Filter: (NOT active)
  • Rows Removed by Filter: 1,028
16. 0.100 0.140 ↑ 1.0 353 1

Bitmap Heap Scan on api_ack (cost=7.02..453.03 rows=353 width=4) (actual time=0.047..0.140 rows=353 loops=1)

  • Recheck Cond: ((account)::text = '729650'::text)
  • Filter: (branch_id IS NULL)
  • Heap Blocks: exact=9
17. 0.040 0.040 ↑ 1.0 353 1

Bitmap Index Scan on api_ack_account_0fd242e7_like (cost=0.00..6.93 rows=353 width=0) (actual time=0.040..0.040 rows=353 loops=1)

  • Index Cond: ((account)::text = '729650'::text)
18. 72.975 72.975 ↑ 1.0 1 24,325

Index Only Scan using host_system_uuid_stale_warn_at on api_host v1 (cost=0.43..1.05 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=24,325)

  • Index Cond: ((system_uuid = v0.system_uuid) AND (stale_warn_at > '2020-10-15 15:37:50.885368+00'::timestamp with time zone))
  • Heap Fetches: 20,567
19. 0.000 0.000 ↓ 0.0 0 24,006

Materialize (cost=0.28..8.30 rows=1 width=20) (actual time=0.000..0.000 rows=0 loops=24,006)

20. 0.007 0.007 ↓ 0.0 0 1

Index Scan using api_hostack_account_97691895_like on api_hostack u0 (cost=0.28..8.29 rows=1 width=20) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((account)::text = '729650'::text)
Planning time : 1.299 ms
Execution time : 157.466 ms