explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mx3C

Settings
# exclusive inclusive rows x rows loops node
1. 0.027 10,519.336 ↑ 1.0 1 1

Aggregate (cost=136,959.97..136,959.98 rows=1 width=8) (actual time=10,519.336..10,519.336 rows=1 loops=1)

2.          

CTE call_agent_queues_custom

3. 0.010 0.033 ↓ 7.0 7 1

Nested Loop (cost=4.59..24.86 rows=1 width=4) (actual time=0.015..0.033 rows=7 loops=1)

4. 0.007 0.007 ↑ 1.0 1 1

Index Scan using idx_call_agents_employee_id on call_agents ca (cost=0.28..8.30 rows=1 width=4) (actual time=0.006..0.007 rows=1 loops=1)

  • Index Cond: (employee_id = 4,343)
5. 0.012 0.016 ↓ 1.8 7 1

Bitmap Heap Scan on call_agent_queues caq (cost=4.31..16.52 rows=4 width=8) (actual time=0.007..0.016 rows=7 loops=1)

  • Recheck Cond: (call_agent_id = ca.id)
  • Heap Blocks: exact=1
6. 0.004 0.004 ↓ 1.8 7 1

Bitmap Index Scan on idx_call_agent_queues_call_agent_id (cost=0.00..4.31 rows=4 width=0) (actual time=0.004..0.004 rows=7 loops=1)

  • Index Cond: (call_agent_id = ca.id)
7. 1,673.866 10,519.309 ↑ 22.0 6 1

Hash Join (cost=125,805.97..136,934.78 rows=132 width=4) (actual time=326.840..10,519.309 rows=6 loops=1)

  • Hash Cond: (cm.call_id = c.id)
8. 2,275.772 8,845.316 ↓ 94.3 19,630,332 1

Nested Loop (cost=0.58..10,582.99 rows=208,158 width=4) (actual time=0.037..8,845.316 rows=19,630,332 loops=1)

9. 0.034 0.121 ↓ 7.0 7 1

Nested Loop (cost=0.15..8.23 rows=1 width=8) (actual time=0.021..0.121 rows=7 loops=1)

10. 0.052 0.052 ↓ 7.0 7 1

CTE Scan on call_agent_queues_custom caqc (cost=0.00..0.02 rows=1 width=4) (actual time=0.017..0.052 rows=7 loops=1)

11. 0.035 0.035 ↑ 1.0 1 7

Index Only Scan using pk_call_queues on call_queues cq (cost=0.15..8.17 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=7)

  • Index Cond: (id = caqc.call_agent_queue_id)
  • Heap Fetches: 5
12. 6,569.423 6,569.423 ↓ 13.5 2,804,333 7

Index Scan using idx_call_members_call_queue_id on call_members cm (cost=0.44..8,493.18 rows=208,158 width=8) (actual time=0.017..938.489 rows=2,804,333 loops=7)

  • Index Cond: (call_queue_id = cq.id)
13. 0.011 0.127 ↑ 1,513.5 35 1

Hash (cost=125,143.23..125,143.23 rows=52,972 width=4) (actual time=0.127..0.127 rows=35 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 514kB
14. 0.116 0.116 ↑ 1,513.5 35 1

Index Scan using idx_calls_call_status_type_id on calls c (cost=0.57..125,143.23 rows=52,972 width=4) (actual time=0.026..0.116 rows=35 loops=1)

  • Index Cond: (call_status_type_id = ANY ('{7,9}'::integer[]))
Planning time : 0.765 ms
Execution time : 10,519.413 ms