explain.depesz.com

PostgreSQL's explain analyze made readable

Result: u2vs

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 10,789.661 ↑ 1.0 5 1

Limit (cost=29,055.81..29,055.82 rows=5 width=1,596) (actual time=10,789.657..10,789.661 rows=5 loops=1)

2. 256.201 10,789.656 ↑ 8.8 5 1

Sort (cost=29,055.81..29,055.92 rows=44 width=1,596) (actual time=10,789.656..10,789.656 rows=5 loops=1)

  • Sort Key: c.customer_name
  • Sort Method: top-N heapsort Memory: 25kB
3. 109.614 10,533.455 ↓ 13,634.5 599,918 1

Nested Loop (cost=697.13..29,055.08 rows=44 width=1,596) (actual time=1,261.809..10,533.455 rows=599,918 loops=1)

  • Join Filter: (c.customer_type_id = ct.customer_type_internal_id)
  • Rows Removed by Join Filter: 1199836
4. 0.020 0.020 ↓ 3.0 3 1

Seq Scan on customer_type ct (cost=0.00..1.05 rows=1 width=524) (actual time=0.010..0.020 rows=3 loops=1)

  • Filter: ((start_date <= '2020-01-01'::date) AND (end_date > '2020-01-01'::date) AND (request_id = 0))
5. 5,811.117 10,423.821 ↓ 4,510.7 599,918 3

Hash Join (cost=697.13..29,052.37 rows=133 width=1,088) (actual time=1,201.063..3,474.607 rows=599,918 loops=3)

  • Hash Cond: (c.customer_internal_id = ca.customer_internal_id)
6. 1,113.429 1,113.429 ↑ 1.0 1,048,575 3

Seq Scan on customer c (cost=0.00..24,421.75 rows=1,048,575 width=51) (actual time=0.062..371.143 rows=1,048,575 loops=3)

7. 1,265.571 3,499.275 ↓ 4,510.7 599,920 3

Hash (cost=695.47..695.47 rows=133 width=1,045) (actual time=1,166.425..1,166.425 rows=599,920 loops=3)

  • Buckets: 65536 (originally 1024) Batches: 16 (originally 1) Memory Usage: 3585kB
8. 332.811 2,233.704 ↓ 4,510.7 599,920 3

Nested Loop (cost=6.04..695.47 rows=133 width=1,045) (actual time=0.686..744.568 rows=599,920 loops=3)

9. 7.383 7.383 ↓ 7,013.0 7,013 3

Function Scan on getgeographiesinspan g (cost=0.25..17.75 rows=1 width=1,040) (actual time=0.576..2.461 rows=7,013 loops=3)

  • Filter: ((start_date <= '2020-01-01'::date) AND (end_date > '2020-01-01'::date) AND (request_id = 0))
10. 1,641.042 1,893.510 ↑ 1.5 86 21,039

Bitmap Heap Scan on customer_alignment ca (cost=5.79..676.39 rows=133 width=21) (actual time=0.036..0.090 rows=86 loops=21,039)

  • Recheck Cond: (geography_internal_id = g.geography_internal_id)
  • Filter: ((start_date <= '2020-01-01'::date) AND (end_date > '2020-01-01'::date) AND (request_id = 0) AND (team_internal_id = 69))
  • Rows Removed by Filter: 29
  • Heap Blocks: exact=2342991
11. 252.468 252.468 ↑ 1.6 114 21,039

Bitmap Index Scan on customer_alignment_geography_internal_id_idx (cost=0.00..5.76 rows=178 width=0) (actual time=0.012..0.012 rows=114 loops=21,039)

  • Index Cond: (geography_internal_id = g.geography_internal_id)
Planning time : 1.224 ms
Execution time : 10,790.602 ms