explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 21IJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 0.138 ↓ 0.0 0 1

Nested Loop (cost=8.62..12,877.82 rows=1 width=104) (actual time=0.138..0.138 rows=0 loops=1)

  • Join Filter: (r.salesman_id = s.id)
2. 0.064 0.064 ↑ 1.0 5 1

Index Only Scan using salesman_pkey on salesman s (cost=0.29..25.54 rows=5 width=8) (actual time=0.016..0.064 rows=5 loops=1)

  • Index Cond: (id = ANY ('{1,2,3,4,5}'::bigint[]))
  • Heap Fetches: 4
3. 0.002 0.070 ↓ 0.0 0 5

Materialize (cost=8.33..12,852.06 rows=3 width=112) (actual time=0.014..0.014 rows=0 loops=5)

4. 0.009 0.068 ↓ 0.0 0 1

Hash Join (cost=8.33..12,852.05 rows=3 width=112) (actual time=0.068..0.068 rows=0 loops=1)

  • Hash Cond: (rd.route_id = r.id)
5. 0.018 0.018 ↑ 158,586.0 1 1

Seq Scan on salesman_route_detail rd (cost=0.00..12,427.40 rows=158,586 width=112) (actual time=0.018..0.018 rows=1 loops=1)

  • Filter: (enabled AND (NOT is_deleted))
6. 0.000 0.041 ↓ 0.0 0 1

Hash (cost=8.31..8.31 rows=1 width=16) (actual time=0.041..0.041 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
7. 0.041 0.041 ↓ 0.0 0 1

Index Scan using salesman_route_date_idx on salesman_route r (cost=0.29..8.31 rows=1 width=16) (actual time=0.041..0.041 rows=0 loops=1)

  • Index Cond: ((route_date >= now()) AND (route_date <= now()))
  • Filter: (enabled AND (NOT is_deleted))
Planning time : 1.621 ms
Execution time : 0.217 ms