explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UBez

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 762.463 ↑ 1.0 1 1

Limit (cost=18,177.21..18,177.21 rows=1 width=29) (actual time=762.460..762.463 rows=1 loops=1)

2. 11.054 762.458 ↑ 1,024.0 1 1

Sort (cost=18,177.21..18,179.77 rows=1,024 width=29) (actual time=762.458..762.458 rows=1 loops=1)

  • Sort Key: ig.sorting, cs.id NULLS FIRST, c.phone
  • Sort Method: top-N heapsort Memory: 25kB
3. 22.310 751.404 ↓ 35.2 36,006 1

Nested Loop Anti Join (cost=48.98..18,172.09 rows=1,024 width=29) (actual time=41.534..751.404 rows=36,006 loops=1)

4. 2.070 548.719 ↓ 35.2 36,075 1

Nested Loop Left Join (cost=48.41..10,609.52 rows=1,026 width=29) (actual time=41.510..548.719 rows=36,075 loops=1)

  • Filter: ((cs.id IS NULL) OR ((cs.created_at + '1 day'::interval) < '2019-07-10 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 3857
5. 5.537 426.853 ↓ 13.0 39,932 1

Nested Loop (cost=47.98..6,620.28 rows=3,078 width=29) (actual time=0.308..426.853 rows=39,932 loops=1)

6. 0.007 0.278 ↑ 1.0 3 1

Nested Loop (cost=47.54..72.21 rows=3 width=18) (actual time=0.254..0.278 rows=3 loops=1)

7. 0.008 0.253 ↑ 1.0 3 1

HashAggregate (cost=47.26..47.29 rows=3 width=8) (actual time=0.249..0.253 rows=3 loops=1)

  • Group Key: import_group.id
8. 0.001 0.245 ↑ 1.0 3 1

Limit (cost=47.22..47.23 rows=3 width=10) (actual time=0.244..0.245 rows=3 loops=1)

9. 0.052 0.244 ↑ 40.7 3 1

Sort (cost=47.22..47.52 rows=122 width=10) (actual time=0.244..0.244 rows=3 loops=1)

  • Sort Key: import_group.sorting, import_group.id DESC
  • Sort Method: top-N heapsort Memory: 25kB
10. 0.151 0.192 ↓ 2.3 276 1

Bitmap Heap Scan on import_group (cost=14.75..45.64 rows=122 width=10) (actual time=0.051..0.192 rows=276 loops=1)

  • Recheck Cond: (project_id = 5)
  • Filter: (is_active = 1)
  • Rows Removed by Filter: 50
  • Heap Blocks: exact=22
11. 0.041 0.041 ↓ 1.2 407 1

Bitmap Index Scan on import_group__project_id__ind (cost=0.00..14.72 rows=326 width=0) (actual time=0.041..0.041 rows=407 loops=1)

  • Index Cond: (project_id = 5)
12. 0.018 0.018 ↑ 1.0 1 3

Index Scan using import_group__id__ind on import_group ig (cost=0.28..8.29 rows=1 width=10) (actual time=0.005..0.006 rows=1 loops=3)

  • Index Cond: (id = import_group.id)
13. 421.038 421.038 ↓ 5.9 13,311 3

Index Scan using idx_c744045557fb67bd on client c (cost=0.43..2,159.95 rows=2,274 width=35) (actual time=21.488..140.346 rows=13,311 loops=3)

  • Index Cond: (import_group_id = ig.id)
  • Filter: (((serviced_by_operator_id IS NULL) OR (serviced_by_operator_id = 1888)) AND ((queue)::text = 'auto'::text) AND ((timezone)::text = ANY ('{+0600,+1200,+0500,+0500,+0500,+0500,+0400,+0700,+0700,+0600,+0800,+0900,+0800,+0530,+0600,+0900,+0400,+0500,+0700,+0800,+0700,+0800,+0700,+0900,+0430,+1200,+0500,+0545,+0900,+0530,+0700,+0800,+0800,+0800,+1100,+0800,+0800,+0400,+0700,+0700,+0600,+0500,+0700,+0700,+0900,+0600,+1100,+0500,+0900,+0800,+0800,+1100,+0800,+0500,+0400,+0430,+0600,+0900,+0700,+0800,+0600,+1000,+0700,+1000,+0900,+0630,+0500,+0400}'::text[])))
  • Rows Removed by Filter: 77528
14. 119.796 119.796 ↑ 1.0 1 39,932

Index Scan using client_status_pkey on client_status cs (cost=0.43..1.28 rows=1 width=16) (actual time=0.002..0.003 rows=1 loops=39,932)

  • Index Cond: (id = c.last_client_status_id)
15. 180.375 180.375 ↓ 0.0 0 36,075

Index Scan using call_event_log__client_id__ind on call_event_log cel (cost=0.56..7.37 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=36,075)

  • Index Cond: (client_id = c.id)
  • Filter: ((created_at > '2019-07-10 00:00:00'::timestamp without time zone) AND ((name)::text = 'CallEvents.callPSTN'::text))
  • Rows Removed by Filter: 4
Planning time : 1.456 ms
Execution time : 762.540 ms