explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6l6l

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=132,449.50..149,656.85 rows=396,587 width=20) (actual rows= loops=)

  • Group Key: users.id
2. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=132,449.50..144,465.06 rows=2,668,017 width=12) (actual rows= loops=)

  • Merge Cond: (users.id = orders.user_id)
3. 0.000 0.000 ↓ 0.0

Sort (cost=87,054.32..87,726.10 rows=1,343,554 width=8) (actual rows= loops=)

  • Sort Key: users.id
4. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=18,419.85..59,702.76 rows=1,343,554 width=8) (actual rows= loops=)

  • Hash Cond: (baskets.user_id = users.id)
5. 0.000 0.000 ↓ 0.0

Seq Scan on baskets (cost=0.00..35,842.39 rows=1,879,797 width=8) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Hash (cost=17,031.80..17,031.80 rows=396,587 width=4) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Index Only Scan using users_pkey on users (cost=0.08..17,031.80 rows=396,587 width=4) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Sort (cost=45,395.14..45,788.91 rows=787,539 width=8) (actual rows= loops=)

  • Sort Key: orders.user_id
9. 0.000 0.000 ↓ 0.0

Seq Scan on orders (cost=0.00..29,969.62 rows=787,539 width=8) (actual rows= loops=)