explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OEJa

Settings
# exclusive inclusive rows x rows loops node
1. 0.093 1,005.480 ↑ 1.0 1 1

Aggregate (cost=54,453.11..54,453.12 rows=1 width=12) (actual time=1,005.480..1,005.480 rows=1 loops=1)

2. 0.009 1,005.387 ↓ 1.2 16 1

Append (cost=0.00..54,452.92 rows=13 width=0) (actual time=0.050..1,005.387 rows=16 loops=1)

3. 0.014 1.806 ↓ 1.2 15 1

Subquery Scan on *SELECT* 1 (cost=0.00..170.59 rows=12 width=0) (actual time=0.050..1.806 rows=15 loops=1)

4. 1.792 1.792 ↓ 1.2 15 1

Seq Scan on shippers (cost=0.00..170.47 rows=12 width=0) (actual time=0.046..1.792 rows=15 loops=1)

  • Filter: (active AND is_online AND (city_id = 1))
  • Rows Removed by Filter: 2583
5. 0.236 1,003.572 ↑ 1.0 1 1

Aggregate (cost=54,282.30..54,282.31 rows=1 width=4) (actual time=1,003.572..1,003.572 rows=1 loops=1)

6. 1.003 1,003.336 ↑ 1.2 124 1

Hash Join (cost=174.14..54,281.93 rows=147 width=4) (actual time=212.544..1,003.336 rows=124 loops=1)

  • Hash Cond: (orders.shipper_id = shippers_1.user_id)
7. 1,000.741 1,000.741 ↑ 1.3 1,436 1

Seq Scan on orders (cost=0.00..54,099.45 rows=1,833 width=4) (actual time=7.886..1,000.741 rows=1,436 loops=1)

  • Filter: ((status = 'done'::order_status_enum) AND (date_trunc('day'::text, created_at) = date_trunc('day'::text, now())))
  • Rows Removed by Filter: 560437
8. 0.195 1.592 ↑ 1.0 293 1

Hash (cost=170.47..170.47 rows=293 width=4) (actual time=1.592..1.592 rows=293 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
9. 1.397 1.397 ↑ 1.0 293 1

Seq Scan on shippers shippers_1 (cost=0.00..170.47 rows=293 width=4) (actual time=0.024..1.397 rows=293 loops=1)

  • Filter: (city_id = 1)
  • Rows Removed by Filter: 2305