explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HRPd

Settings
# exclusive inclusive rows x rows loops node
1. 0.038 833.462 ↑ 1.0 1 1

Aggregate (cost=54,456.63..54,456.64 rows=1 width=8) (actual time=833.462..833.462 rows=1 loops=1)

2. 0.010 833.424 ↑ 4.8 33 1

Append (cost=0.00..54,455.84 rows=159 width=8) (actual time=0.031..833.424 rows=33 loops=1)

3. 1.648 1.648 ↓ 1.2 15 1

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

  • Filter: (active AND is_online AND (city_id = 1))
  • Rows Removed by Filter: 2583
4. 0.012 831.766 ↑ 8.2 18 1

Subquery Scan on *SELECT* 2 (cost=54,282.30..54,285.24 rows=147 width=8) (actual time=831.722..831.766 rows=18 loops=1)

5. 0.257 831.754 ↑ 8.2 18 1

HashAggregate (cost=54,282.30..54,283.77 rows=147 width=4) (actual time=831.714..831.754 rows=18 loops=1)

  • Group Key: shippers_1.user_id
6. 0.996 831.497 ↑ 1.2 125 1

Hash Join (cost=174.14..54,281.93 rows=147 width=4) (actual time=144.998..831.497 rows=125 loops=1)

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

Seq Scan on orders (cost=0.00..54,099.45 rows=1,833 width=4) (actual time=5.183..828.999 rows=1,417 loops=1)

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

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

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

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

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