explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1z5g

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 26,542.254 ↓ 0.0 0 1

Limit (cost=10,762,691.34..10,762,726.35 rows=2,001 width=62) (actual time=26,542.254..26,542.254 rows=0 loops=1)

2. 0.000 26,542.252 ↓ 0.0 0 1

Unique (cost=10,762,691.34..10,763,327.81 rows=36,370 width=62) (actual time=26,542.252..26,542.252 rows=0 loops=1)

3. 0.069 26,542.252 ↓ 0.0 0 1

Sort (cost=10,762,691.34..10,762,782.26 rows=36,370 width=62) (actual time=26,542.252..26,542.252 rows=0 loops=1)

  • Sort Key: p.eventid, p.objectid, p.clock, p.ns, p.name, p.severity
  • Sort Method: quicksort Memory: 25kB
4. 0.001 26,542.183 ↓ 0.0 0 1

Nested Loop (cost=1.70..10,759,936.22 rows=36,370 width=62) (actual time=26,542.183..26,542.183 rows=0 loops=1)

5. 0.000 26,542.182 ↓ 0.0 0 1

Nested Loop (cost=1.28..10,714,837.38 rows=100,638 width=70) (actual time=26,542.182..26,542.182 rows=0 loops=1)

6. 0.002 26,542.182 ↓ 0.0 0 1

Nested Loop (cost=0.85..10,660,638.56 rows=100,638 width=70) (actual time=26,542.182..26,542.182 rows=0 loops=1)

7. 0.000 26,542.180 ↓ 0.0 0 1

Nested Loop Anti Join (cost=0.42..10,625,653.98 rows=50,694 width=62) (actual time=26,542.180..26,542.180 rows=0 loops=1)

8. 714.770 26,542.180 ↓ 0.0 0 1

Seq Scan on problem p (cost=0.00..10,494,672.19 rows=263,537 width=62) (actual time=26,542.180..26,542.180 rows=0 loops=1)

  • Filter: ((r_eventid IS NULL) AND (source = 0) AND (object = 0) AND (NOT (SubPlan 1)))
  • Rows Removed by Filter: 527,092
9.          

SubPlan (for Seq Scan)

10. 1,054.180 25,827.410 ↑ 8.0 1 527,090

HashAggregate (cost=19.87..19.99 rows=8 width=12) (actual time=0.049..0.049 rows=1 loops=527,090)

  • Filter: ((max(r.permission) < 2) OR (min(r.permission) IS NULL) OR (min(r.permission) = 0))
11. 4,111.506 24,773.230 ↓ 1.6 13 527,090

Nested Loop Left Join (cost=1.56..19.79 rows=8 width=12) (actual time=0.008..0.047 rows=13 loops=527,090)

12. 2,212.791 7,379.260 ↓ 1.6 13 527,090

Nested Loop (cost=1.27..15.91 rows=8 width=16) (actual time=0.005..0.014 rows=13 loops=527,090)

13. 1,158.611 3,689.630 ↓ 1.5 3 527,090

Nested Loop (cost=0.85..14.84 rows=2 width=8) (actual time=0.003..0.007 rows=3 loops=527,090)

14. 1,054.180 1,054.180 ↓ 1.5 3 527,090

Index Scan using functions_1 on functions f_1 (cost=0.43..5.93 rows=2 width=8) (actual time=0.001..0.002 rows=3 loops=527,090)

  • Index Cond: (p.objectid = triggerid)
15. 1,476.839 1,476.839 ↑ 1.0 1 1,476,839

Index Scan using items_pkey on items i_1 (cost=0.43..4.45 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=1,476,839)

  • Index Cond: (itemid = f_1.itemid)
16. 1,476.839 1,476.839 ↑ 1.0 4 1,476,839

Index Only Scan using hosts_groups_1 on hosts_groups hgg (cost=0.41..0.50 rows=4 width=16) (actual time=0.001..0.001 rows=4 loops=1,476,839)

  • Index Cond: (hostid = i_1.hostid)
  • Heap Fetches: 0
17. 13,282.464 13,282.464 ↓ 0.0 0 6,641,232

Index Scan using rights_2 on rights r (cost=0.29..0.47 rows=1 width=12) (actual time=0.002..0.002 rows=0 loops=6,641,232)

  • Index Cond: (id = hgg.groupid)
  • Filter: (groupid = ANY ('{11,13,14,990,1142}'::bigint[]))
  • Rows Removed by Filter: 6
18. 0.000 0.000 ↓ 0.0 0

Index Only Scan using event_suppress_1 on event_suppress es (cost=0.42..0.50 rows=2 width=8) (never executed)

  • Index Cond: (eventid = p.eventid)
  • Heap Fetches: 0
19. 0.000 0.000 ↓ 0.0 0

Index Scan using functions_1 on functions f (cost=0.43..0.67 rows=2 width=16) (never executed)

  • Index Cond: (triggerid = p.objectid)
20. 0.000 0.000 ↓ 0.0 0

Index Scan using items_pkey on items i (cost=0.43..0.53 rows=1 width=16) (never executed)

  • Index Cond: (itemid = f.itemid)
21. 0.000 0.000 ↓ 0.0 0

Index Only Scan using hosts_groups_1 on hosts_groups hg (cost=0.41..0.44 rows=1 width=8) (never executed)

  • Index Cond: ((hostid = i.hostid) AND (groupid = 594))
  • Heap Fetches: 0
Total runtime : 26,542.733 ms