explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lejc

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 222.548 ↑ 1.0 1 1

Nested Loop (cost=1,161.61..72,196.01 rows=1 width=8) (actual time=222.539..222.548 rows=1 loops=1)

  • Join Filter: (s.call_id = uc.call_id)
  • Rows Removed by Join Filter: 1
2. 0.016 222.535 ↑ 1.0 1 1

Nested Loop Anti Join (cost=1,161.61..72,194.92 rows=1 width=51) (actual time=222.526..222.535 rows=1 loops=1)

3. 0.029 222.509 ↑ 1.0 1 1

Nested Loop Anti Join (cost=1,161.05..72,186.94 rows=1 width=101) (actual time=222.500..222.509 rows=1 loops=1)

4. 0.117 222.038 ↓ 26.0 26 1

Nested Loop Left Join (cost=1,160.49..72,178.96 rows=1 width=151) (actual time=217.963..222.038 rows=26 loops=1)

  • Join Filter: (ae2.exten = (a1.args -> 'line_num'::text))
  • Rows Removed by Join Filter: 104
5. 0.208 221.791 ↓ 26.0 26 1

Nested Loop (cost=1,160.49..72,177.75 rows=1 width=151) (actual time=217.929..221.791 rows=26 loops=1)

  • Join Filter: (s.call_id = a1.call_id)
6. 3.295 219.621 ↓ 36.3 109 1

Nested Loop (cost=1,159.93..72,153.81 rows=3 width=88) (actual time=118.388..219.621 rows=109 loops=1)

7. 23.839 169.526 ↓ 13.6 1,950 1

Hash Join (cost=1,159.50..70,983.59 rows=143 width=71) (actual time=13.318..169.526 rows=1,950 loops=1)

  • Hash Cond: ((a2.args -> 'line_num'::text) = ae1.exten)
8. 136.735 145.671 ↑ 1.0 27,689 1

Bitmap Heap Scan on call_details a2 (cost=1,158.35..70,837.92 rows=28,618 width=71) (actual time=13.224..145.671 rows=27,689 loops=1)

  • Recheck Cond: (dtype = 'AnsweredInternalCall'::text)
  • Heap Blocks: exact=19051
9. 8.936 8.936 ↑ 1.0 27,689 1

Bitmap Index Scan on call_details_dtype_dtime_idx (cost=0.00..1,151.19 rows=28,618 width=0) (actual time=8.936..8.936 rows=27,689 loops=1)

  • Index Cond: (dtype = 'AnsweredInternalCall'::text)
10. 0.002 0.016 ↑ 1.0 1 1

Hash (cost=1.14..1.14 rows=1 width=11) (actual time=0.016..0.016 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.014 0.014 ↑ 1.0 1 1

Seq Scan on agent_extens ae1 (cost=0.00..1.14 rows=1 width=11) (actual time=0.012..0.014 rows=1 loops=1)

  • Filter: ((userid = 'bara'::text) AND (now() <@ range))
  • Rows Removed by Filter: 7
12. 46.800 46.800 ↓ 0.0 0 1,950

Index Scan using call_details_call_id_idx on call_details s (cost=0.43..8.17 rows=1 width=17) (actual time=0.024..0.024 rows=0 loops=1,950)

  • Index Cond: (call_id = a2.call_id)
  • Filter: ((dtype = 'StartCall'::text) AND ((args -> 'caller_type'::text) = 'originate'::text))
  • Rows Removed by Filter: 10
13. 1.962 1.962 ↓ 0.0 0 109

Index Scan using call_details_call_id_dtype_expr_idx on call_details a1 (cost=0.56..7.97 rows=1 width=71) (actual time=0.018..0.018 rows=0 loops=109)

  • Index Cond: ((call_id = a2.call_id) AND (dtype = 'AnsweredInternalCall'::text))
  • Filter: (cel_id <> a2.cel_id)
  • Rows Removed by Filter: 1
14. 0.130 0.130 ↑ 1.2 5 26

Seq Scan on agent_extens ae2 (cost=0.00..1.12 rows=6 width=11) (actual time=0.003..0.005 rows=5 loops=26)

  • Filter: (now() <@ range)
  • Rows Removed by Filter: 3
15. 0.442 0.442 ↑ 1.0 1 26

Index Scan using call_details_call_id_dtype_expr_idx on call_details h (cost=0.56..7.97 rows=1 width=67) (actual time=0.017..0.017 rows=1 loops=26)

  • Index Cond: ((call_id = a1.call_id) AND (dtype = 'Hangup'::text) AND ((args -> 'channel_name'::text) = (a1.args -> 'channel_name'::text)))
16. 0.010 0.010 ↓ 0.0 0 1

Index Scan using call_details_call_id_dtype_expr_idx on call_details h_1 (cost=0.56..7.97 rows=1 width=67) (actual time=0.010..0.010 rows=0 loops=1)

  • Index Cond: ((call_id = a2.call_id) AND (dtype = 'Hangup'::text) AND ((args -> 'channel_name'::text) = (a2.args -> 'channel_name'::text)))
17. 0.009 0.009 ↑ 1.0 2 1

Seq Scan on unprocessed_calls uc (cost=0.00..1.06 rows=2 width=18) (actual time=0.008..0.009 rows=2 loops=1)

  • Filter: (NOT finished)
  • Rows Removed by Filter: 4