explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OX5u

Settings
# exclusive inclusive rows x rows loops node
1. 62.279 1,328.871 ↓ 18.7 63,743 1

Sort (cost=52,323.64..52,332.17 rows=3,413 width=29) (actual time=1,321.705..1,328.871 rows=63,743 loops=1)

  • Sort Key: ig.sorting, cs.id NULLS FIRST, c.phone
  • Sort Method: quicksort Memory: 6516kB
2. 21.812 1,266.592 ↓ 18.7 63,743 1

Hash Anti Join (cost=16,853.88..52,123.35 rows=3,413 width=29) (actual time=385.744..1,266.592 rows=63,743 loops=1)

  • Hash Cond: (c.id = cel.client_id)
3. 35.292 860.591 ↓ 18.7 63,817 1

Nested Loop Left Join (cost=49.40..35,218.67 rows=3,420 width=29) (actual time=1.521..860.591 rows=63,817 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: 3931
4. 6.878 689.803 ↓ 6.6 67,748 1

Nested Loop (cost=48.96..21,919.49 rows=10,261 width=29) (actual time=0.969..689.803 rows=67,748 loops=1)

5. 0.246 1.025 ↑ 1.0 10 1

Hash Semi Join (cost=48.53..92.52 rows=10 width=18) (actual time=0.880..1.025 rows=10 loops=1)

  • Hash Cond: (ig.id = "ANY_subquery".id)
6. 0.209 0.209 ↓ 1.0 1,421 1

Seq Scan on import_group ig (cost=0.00..40.16 rows=1,416 width=10) (actual time=0.013..0.209 rows=1,421 loops=1)

7. 0.002 0.570 ↑ 1.0 10 1

Hash (cost=48.40..48.40 rows=10 width=8) (actual time=0.570..0.570 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
8. 0.007 0.568 ↑ 1.0 10 1

Subquery Scan on ANY_subquery (cost=48.28..48.40 rows=10 width=8) (actual time=0.560..0.568 rows=10 loops=1)

9. 0.003 0.561 ↑ 1.0 10 1

Limit (cost=48.28..48.30 rows=10 width=10) (actual time=0.558..0.561 rows=10 loops=1)

10. 0.146 0.558 ↑ 12.2 10 1

Sort (cost=48.28..48.58 rows=122 width=10) (actual time=0.557..0.558 rows=10 loops=1)

  • Sort Key: import_group.sorting, import_group.id DESC
  • Sort Method: top-N heapsort Memory: 25kB
11. 0.304 0.412 ↓ 2.3 276 1

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

  • Recheck Cond: (project_id = 5)
  • Filter: (is_active = 1)
  • Rows Removed by Filter: 50
  • Heap Blocks: exact=22
12. 0.108 0.108 ↓ 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.108..0.108 rows=407 loops=1)

  • Index Cond: (project_id = 5)
13. 681.900 681.900 ↓ 3.0 6,775 10

Index Scan using idx_c744045557fb67bd on client c (cost=0.43..2,159.96 rows=2,274 width=35) (actual time=32.975..68.190 rows=6,775 loops=10)

  • Index Cond: (import_group_id = ig.id)
  • Filter: (((serviced_by_operator_id IS NULL) OR (serviced_by_operator_id = 1874)) 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: 50458
14. 135.496 135.496 ↑ 1.0 1 67,748

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

  • Index Cond: (id = c.last_client_status_id)
15. 31.001 384.189 ↓ 6.9 130,686 1

Hash (cost=16,569.04..16,569.04 rows=18,835 width=8) (actual time=384.189..384.189 rows=130,686 loops=1)

  • Buckets: 131072 (originally 32768) Batches: 1 (originally 1) Memory Usage: 6129kB
16. 353.188 353.188 ↓ 6.9 130,686 1

Index Scan using call_event_log__created_at__ind on call_event_log cel (cost=0.56..16,569.04 rows=18,835 width=8) (actual time=0.017..353.188 rows=130,686 loops=1)

  • Index Cond: (created_at > '2019-07-10 00:00:00'::timestamp without time zone)
  • Filter: ((name)::text = 'CallEvents.callPSTN'::text)
  • Rows Removed by Filter: 487651
Planning time : 3.553 ms
Execution time : 1,333.186 ms