explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bCla

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

Limit (cost=52,242.99..52,242.99 rows=1 width=29) (actual time=1,410.803..1,410.807 rows=1 loops=1)

2. 12.821 1,410.802 ↑ 3,413.0 1 1

Sort (cost=52,242.99..52,251.52 rows=3,413 width=29) (actual time=1,410.802..1,410.802 rows=1 loops=1)

  • Sort Key: ig.sorting, cs.id NULLS FIRST, c.phone
  • Sort Method: top-N heapsort Memory: 25kB
3. 19.443 1,397.981 ↓ 18.7 63,738 1

Hash Anti Join (cost=16,955.02..52,225.92 rows=3,413 width=29) (actual time=385.284..1,397.981 rows=63,738 loops=1)

  • Hash Cond: (c.id = cel.client_id)
4. 51.270 994.268 ↓ 18.7 63,811 1

Nested Loop Left Join (cost=49.40..35,220.12 rows=3,420 width=29) (actual time=0.989..994.268 rows=63,811 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: 3933
5. 7.700 807.510 ↓ 6.6 67,744 1

Nested Loop (cost=48.96..21,919.61 rows=10,261 width=29) (actual time=0.560..807.510 rows=67,744 loops=1)

6. 0.216 0.690 ↑ 1.0 10 1

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

  • Hash Cond: (ig.id = "ANY_subquery".id)
7. 0.221 0.221 ↓ 1.0 1,423 1

Seq Scan on import_group ig (cost=0.00..40.16 rows=1,416 width=10) (actual time=0.007..0.221 rows=1,423 loops=1)

8. 0.004 0.253 ↑ 1.0 10 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.004 0.249 ↑ 1.0 10 1

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

10. 0.000 0.245 ↑ 1.0 10 1

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

11. 0.054 0.245 ↑ 12.2 10 1

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

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

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

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

  • Index Cond: (project_id = 5)
14. 799.120 799.120 ↓ 3.0 6,774 10

Index Scan using idx_c744045557fb67bd on client c (cost=0.43..2,159.97 rows=2,274 width=35) (actual time=38.976..79.912 rows=6,774 loops=10)

  • 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: 50459
15. 135.488 135.488 ↑ 1.0 1 67,744

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,744)

  • Index Cond: (id = c.last_client_status_id)
16. 30.808 384.270 ↓ 7.0 133,089 1

Hash (cost=16,668.74..16,668.74 rows=18,950 width=8) (actual time=384.270..384.270 rows=133,089 loops=1)

  • Buckets: 262144 (originally 32768) Batches: 1 (originally 1) Memory Usage: 7247kB
17. 353.462 353.462 ↓ 7.0 133,089 1

Index Scan using call_event_log__created_at__ind on call_event_log cel (cost=0.56..16,668.74 rows=18,950 width=8) (actual time=0.013..353.462 rows=133,089 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: 497828
Planning time : 1.454 ms
Execution time : 1,410.907 ms