explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gAa1

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 9.336 ↓ 0.0 0 1

Nested Loop (cost=22.66..2,263.95 rows=1,000 width=132) (actual time=9.336..9.336 rows=0 loops=1)

2.          

Initplan (for Nested Loop)

3. 0.524 7.423 ↑ 1.0 1 1

Aggregate (cost=12.68..12.69 rows=1 width=32) (actual time=7.423..7.423 rows=1 loops=1)

4. 6.899 6.899 ↑ 1.0 981 1

Function Scan on cc_waiting_agents a (cost=0.18..10.18 rows=1,000 width=12) (actual time=6.811..6.899 rows=981 loops=1)

5. 0.003 9.335 ↓ 0.0 0 1

Nested Loop (cost=9.55..29.57 rows=1,000 width=96) (actual time=9.335..9.335 rows=0 loops=1)

6. 0.006 0.570 ↑ 1.0 1 1

Sort (cost=9.52..9.52 rows=1 width=72) (actual time=0.570..0.570 rows=1 loops=1)

  • Sort Key: q.priority DESC
  • Sort Method: quicksort Memory: 26kB
7. 0.029 0.564 ↑ 1.0 1 1

GroupAggregate (cost=6.98..9.51 rows=1 width=72) (actual time=0.564..0.564 rows=1 loops=1)

  • Group Key: q.id
8. 0.005 0.535 ↓ 3.0 3 1

Nested Loop (cost=6.98..9.48 rows=1 width=56) (actual time=0.318..0.535 rows=3 loops=1)

9. 0.436 0.515 ↓ 3.0 3 1

Group (cost=6.70..6.97 rows=1 width=133) (actual time=0.311..0.515 rows=3 loops=1)

  • Group Key: q_1.id, corg.communication_id, corg.""time"", cor.id
10. 0.011 0.079 ↓ 3.0 3 1

Sort (cost=6.70..6.71 rows=1 width=101) (actual time=0.078..0.079 rows=3 loops=1)

  • Sort Key: corg.communication_id, corg.""time"", cor.id
  • Sort Method: quicksort Memory: 25kB
11. 0.002 0.068 ↓ 3.0 3 1

Nested Loop (cost=2.67..6.69 rows=1 width=101) (actual time=0.054..0.068 rows=3 loops=1)

  • Join Filter: (cqr.resource_group_id = corg.id)
12. 0.003 0.060 ↓ 3.0 3 1

Nested Loop (cost=2.53..5.65 rows=1 width=32) (actual time=0.050..0.060 rows=3 loops=1)

13. 0.004 0.045 ↓ 3.0 3 1

Merge Join (cost=2.26..3.14 rows=1 width=32) (actual time=0.040..0.045 rows=3 loops=1)

  • Merge Cond: (cor.id = corig.resource_id)
14. 0.013 0.013 ↑ 2.0 2 1

Index Scan using cc_queue_resource_id_uindex on cc_outbound_resource cor (cost=0.14..3.60 rows=4 width=8) (actual time=0.010..0.013 rows=2 loops=1)

  • Filter: (enabled AND (NOT reserve))
  • Rows Removed by Filter: 9
15. 0.005 0.028 ↓ 3.0 3 1

Sort (cost=2.12..2.13 rows=1 width=32) (actual time=0.027..0.028 rows=3 loops=1)

  • Sort Key: corig.resource_id
  • Sort Method: quicksort Memory: 25kB
16. 0.008 0.023 ↓ 3.0 3 1

Hash Join (cost=1.04..2.11 rows=1 width=32) (actual time=0.021..0.023 rows=3 loops=1)

  • Hash Cond: (corig.group_id = cqr.resource_group_id)
17. 0.008 0.008 ↑ 1.7 3 1

Seq Scan on cc_outbound_resource_in_group corig (cost=0.00..1.05 rows=5 width=16) (actual time=0.008..0.008 rows=3 loops=1)

18. 0.002 0.007 ↓ 2.0 2 1

Hash (cost=1.02..1.02 rows=1 width=16) (actual time=0.007..0.007 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
19. 0.005 0.005 ↓ 2.0 2 1

Seq Scan on cc_queue_resource cqr (cost=0.00..1.02 rows=1 width=16) (actual time=0.004..0.005 rows=2 loops=1)

  • Filter: (queue_id = 2)
  • Rows Removed by Filter: 2
20. 0.012 0.012 ↑ 1.0 1 3

Index Scan using cc_queue_pkey on cc_queue q_1 (cost=0.28..2.49 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=3)

  • Index Cond: (id = 2)
  • Filter: enabled
21. 0.006 0.006 ↑ 1.0 1 3

Index Scan using cc_outbound_resource_group_distr_res_idx on cc_outbound_resource_group corg (cost=0.14..1.04 rows=1 width=93) (actual time=0.002..0.002 rows=1 loops=3)

  • Index Cond: (id = corig.group_id)
22. 0.015 0.015 ↑ 1.0 1 3

Index Scan using cc_queue_pkey on cc_queue q (cost=0.28..2.49 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=3)

  • Index Cond: (id = 2)
23. 8.762 8.762 ↓ 0.0 0 1

Function Scan on cc_test_cache1 x (cost=0.03..10.03 rows=1,000 width=28) (actual time=8.762..8.762 rows=0 loops=1)

24. 0.000 0.000 ↓ 0.0 0

Index Scan using cc_member_pkey on cc_member m (cost=0.42..2.22 rows=1 width=109) (never executed)

  • Index Cond: (id = x.id)
Planning time : 0.910 ms
Execution time : 9.485 ms