explain.depesz.com

PostgreSQL's explain analyze made readable

Result: e84O

Settings
# exclusive inclusive rows x rows loops node
1. 91.305 1,563.750 ↑ 1.0 4 1

GroupAggregate (cost=23.34..2,090,333.97 rows=4 width=19) (actual time=1,380.675..1,563.750 rows=4 loops=1)

  • Group Key: api_rulecategory.name
2. 76.124 1,472.445 ↓ 3.7 136,431 1

Nested Loop (cost=23.34..2,090,151.02 rows=36,582 width=27) (actual time=164.437..1,472.445 rows=136,431 loops=1)

  • Join Filter: (api_rule.category_id = api_rulecategory.id)
  • Rows Removed by Join Filter: 409293
3. 0.021 0.021 ↑ 1.0 4 1

Index Scan using api_rulecategory_name_key on api_rulecategory (cost=0.13..12.19 rows=4 width=15) (actual time=0.011..0.021 rows=4 loops=1)

4. 101.621 1,396.300 ↓ 3.7 136,431 4

Materialize (cost=23.21..2,088,035.37 rows=36,582 width=20) (actual time=0.168..349.075 rows=136,431 loops=4)

5. 138.138 1,294.679 ↓ 3.7 136,431 1

Nested Loop (cost=23.21..2,087,852.46 rows=36,582 width=20) (actual time=0.647..1,294.679 rows=136,431 loops=1)

6. 308.205 944.543 ↓ 5.2 211,998 1

Index Only Scan using api_currentreport_account_rule_id_system_uuid_f48d4524_uniq on api_currentreport (cost=22.94..2,075,071.17 rows=40,673 width=20) (actual time=0.621..944.543 rows=211,998 loops=1)

  • Index Cond: (account = '729650'::text)
  • Filter: ((NOT (hashed SubPlan 1)) AND ((SubPlan 2) >= 1))
  • Rows Removed by Filter: 31245
  • Heap Fetches: 0
7.          

SubPlan (for Index Only Scan)

8. 0.344 0.344 ↑ 1.0 351 1

Seq Scan on api_ack u2 (cost=0.00..21.50 rows=351 width=4) (actual time=0.019..0.344 rows=351 loops=1)

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 649
9. 0.000 635.994 ↑ 1.0 1 211,998

Aggregate (cost=8.45..8.46 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=211,998)

10. 635.994 635.994 ↑ 1.0 1 211,998

Index Only Scan using api_hosttag_hosts_host_id_hosttag_id_index on api_hosttag_hosts (cost=0.42..8.44 rows=1 width=0) (actual time=0.002..0.003 rows=1 loops=211,998)

  • Index Cond: (host_id = api_currentreport.system_uuid)
  • Filter: (hosttag_id = ANY ('{1}'::integer[]))
  • Heap Fetches: 211998
11. 211.998 211.998 ↑ 1.0 1 211,998

Index Scan using api_rule_pkey on api_rule (cost=0.28..0.31 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=211,998)

  • Index Cond: (id = api_currentreport.rule_id)
  • Filter: active
  • Rows Removed by Filter: 0
Planning time : 1.994 ms
Execution time : 1,564.665 ms