explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CMDI

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 1,362.096 ↑ 1.0 1 1

Nested Loop (cost=1,161.62..72,198.61 rows=1 width=8) (actual time=1,362.087..1,362.096 rows=1 loops=1)

  • Join Filter: (s.call_id = uc.call_id)
  • Rows Removed by Join Filter: 2
2. 0.010 1,362.081 ↑ 1.0 1 1

Nested Loop Anti Join (cost=1,161.62..72,197.48 rows=1 width=51) (actual time=1,362.073..1,362.081 rows=1 loops=1)

3. 0.046 1,362.063 ↑ 1.0 1 1

Nested Loop Anti Join (cost=1,161.06..72,189.50 rows=1 width=101) (actual time=1,362.055..1,362.063 rows=1 loops=1)

4. 0.147 1,361.720 ↓ 27.0 27 1

Nested Loop Left Join (cost=1,160.50..72,181.52 rows=1 width=151) (actual time=1,348.000..1,361.720 rows=27 loops=1)

  • Join Filter: (ae2.exten = (a1.args -> 'line_num'::text))
  • Rows Removed by Join Filter: 108
5. 0.128 1,361.438 ↓ 27.0 27 1

Nested Loop (cost=1,160.50..72,180.31 rows=1 width=151) (actual time=1,347.976..1,361.438 rows=27 loops=1)

  • Join Filter: (s.call_id = a1.call_id)
6. 12.917 1,356.250 ↓ 36.7 110 1

Nested Loop (cost=1,159.94..72,156.37 rows=3 width=88) (actual time=961.027..1,356.250 rows=110 loops=1)

7. 102.453 1,128.723 ↓ 13.6 1,951 1

Hash Join (cost=1,159.51..70,986.15 rows=143 width=71) (actual time=76.649..1,128.723 rows=1,951 loops=1)

  • Hash Cond: ((a2.args -> 'line_num'::text) = ae1.exten)
8. 970.602 1,026.250 ↑ 1.0 27,694 1

Bitmap Heap Scan on call_details a2 (cost=1,158.35..70,840.47 rows=28,619 width=71) (actual time=76.469..1,026.250 rows=27,694 loops=1)

  • Recheck Cond: (dtype = 'AnsweredInternalCall'::text)
  • Heap Blocks: exact=19054
9. 55.648 55.648 ↑ 1.0 27,694 1

Bitmap Index Scan on call_details_dtype_dtime_idx (cost=0.00..1,151.20 rows=28,619 width=0) (actual time=55.648..55.648 rows=27,694 loops=1)

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

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

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

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

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

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

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

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.046..0.046 rows=0 loops=110)

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

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

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

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.011..0.011 rows=1 loops=27)

  • Index Cond: ((call_id = a1.call_id) AND (dtype = 'Hangup'::text) AND ((args -> 'channel_name'::text) = (a1.args -> 'channel_name'::text)))
16. 0.008 0.008 ↓ 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.008..0.008 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 3 1

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

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