explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vQOm

Settings
# exclusive inclusive rows x rows loops node
1. 0.105 6.594 ↑ 1.0 1 1

Aggregate (cost=3,922.13..3,922.14 rows=1 width=8) (actual time=6.594..6.594 rows=1 loops=1)

2. 0.359 6.489 ↓ 52.6 1,000 1

Nested Loop (cost=77.94..3,922.08 rows=19 width=0) (actual time=0.576..6.489 rows=1,000 loops=1)

3. 0.112 2.130 ↓ 8.1 1,000 1

Nested Loop (cost=77.38..3,842.31 rows=123 width=8) (actual time=0.559..2.130 rows=1,000 loops=1)

4. 0.001 0.586 ↑ 1.0 1 1

Nested Loop (cost=57.30..103.59 rows=1 width=5) (actual time=0.269..0.586 rows=1 loops=1)

5. 0.136 0.574 ↑ 1.0 1 1

Hash Join (cost=57.01..95.27 rows=1 width=8) (actual time=0.258..0.574 rows=1 loops=1)

  • Hash Cond: (zba.zip_alignment_internal_id = za.zip_alignment_internal_id)
6. 0.193 0.193 ↑ 1.0 2,000 1

Seq Scan on zip_based_alignment zba (cost=0.00..33.00 rows=2,000 width=8) (actual time=0.006..0.193 rows=2,000 loops=1)

7. 0.002 0.245 ↑ 1.0 1 1

Hash (cost=57.00..57.00 rows=1 width=16) (actual time=0.245..0.245 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
8. 0.243 0.243 ↑ 1.0 1 1

Seq Scan on zip_alignment za (cost=0.00..57.00 rows=1 width=16) (actual time=0.006..0.243 rows=1 loops=1)

  • Filter: ((start_date <= '2020-09-09'::date) AND (end_date > '2020-09-09'::date) AND (zip_internal_id = 1) AND (team_internal_id = 103))
  • Rows Removed by Filter: 1,999
9. 0.011 0.011 ↑ 1.0 1 1

Index Scan using zip_zip_internal_id_idx on zip z (cost=0.29..8.31 rows=1 width=13) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: (zip_internal_id = 1)
10. 1.262 1.432 ↓ 1.0 1,000 1

Bitmap Heap Scan on customer c (cost=20.08..3,728.86 rows=986 width=12) (actual time=0.288..1.432 rows=1,000 loops=1)

  • Recheck Cond: ((zip_code)::text = (z.zip_code)::text)
  • Heap Blocks: exact=1,000
11. 0.170 0.170 ↓ 1.0 1,000 1

Bitmap Index Scan on idx_customer_zip_code (cost=0.00..19.83 rows=986 width=0) (actual time=0.170..0.170 rows=1,000 loops=1)

  • Index Cond: ((zip_code)::text = (z.zip_code)::text)
12. 4.000 4.000 ↑ 1.0 1 1,000

Index Scan using idx_alignment_customer_id_start_end_date on alignment a (cost=0.56..0.64 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=1,000)

  • Index Cond: (customer_internal_id = c.customer_internal_id)
  • Filter: (((alignment_type)::text = ANY ('{zip,"zip,explicit"}'::text[])) AND (team_internal_id = 103))