explain.depesz.com

PostgreSQL's explain analyze made readable

Result: w3Z

Settings
# exclusive inclusive rows x rows loops node
1. 0.122 514.693 ↓ 1.6 21 1

Nested Loop Left Join (cost=9.06..5,246.09 rows=13 width=20) (actual time=43.319..514.693 rows=21 loops=1)

  • Join Filter: (a_s.state_id = s.state_id)
  • Rows Removed by Join Filter: 84
  • Filter: ((s.pause_queues IS NULL) OR (NOT s.pause_queues) OR (s.description = 'Wraptime'::text))
2. 0.219 514.550 ↓ 1.4 21 1

Nested Loop Left Join (cost=9.06..5,243.59 rows=15 width=24) (actual time=43.306..514.550 rows=21 loops=1)

  • Join Filter: (a.name = a_s.userid)
  • Rows Removed by Join Filter: 861
3. 0.113 42.965 ↓ 21.0 21 1

Hash Join (cost=9.06..79.82 rows=1 width=31) (actual time=42.734..42.965 rows=21 loops=1)

  • Hash Cond: (ltrim(peermon_log.name, 'iptel'::text) = a.num)
4. 0.146 0.146 ↓ 3.3 63 1

Index Scan using peermon_log_asterisk_id_name_idx on peermon_log (cost=0.14..70.79 rows=19 width=9) (actual time=0.012..0.146 rows=63 loops=1)

  • Filter: ((name ~~ 'iptel%'::text) AND (channeltype = 'SIP'::text) AND (status = 'OK'::text))
  • Rows Removed by Filter: 4
5. 0.028 42.706 ↓ 3.0 21 1

Hash (cost=8.83..8.83 rows=7 width=31) (actual time=42.706..42.706 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
6. 0.048 42.678 ↓ 3.0 21 1

Seq Scan on agents a (cost=0.00..8.83 rows=7 width=31) (actual time=7.329..42.678 rows=21 loops=1)

  • Filter: (available AND (NOT (SubPlan 1)))
  • Rows Removed by Filter: 8
7.          

SubPlan (for Seq Scan)

8. 42.630 42.630 ↓ 0.0 0 21

Function Scan on get_active_exten_calls (cost=0.25..0.26 rows=1 width=0) (actual time=2.030..2.030 rows=0 loops=21)

  • Filter: (call_id IS NOT NULL)
  • Rows Removed by Filter: 1
9. 471.366 471.366 ↑ 20.1 42 21

Seq Scan on agent_states a_s (cost=0.00..5,153.23 rows=843 width=15) (actual time=0.119..22.446 rows=42 loops=21)

  • Filter: (now() <@ range)
  • Rows Removed by Filter: 86414
10. 0.017 0.021 ↑ 1.0 5 21

Materialize (cost=0.00..1.07 rows=5 width=17) (actual time=0.000..0.001 rows=5 loops=21)

11. 0.004 0.004 ↑ 1.0 5 1

Seq Scan on states s (cost=0.00..1.05 rows=5 width=17) (actual time=0.003..0.004 rows=5 loops=1)

Planning time : 2.805 ms
Execution time : 514.764 ms