explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rhhby

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

Aggregate (cost=1,275.99..1,276.00 rows=1 width=8) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Merge Semi Join (cost=359.41..1,275.99 rows=1 width=4) (actual rows= loops=)

  • Merge Cond: (p0_.id = (unnest(pal.products)))
3. 0.000 0.000 ↓ 0.0

Index Scan using products_pkey on products p0_ (cost=0.29..24.85 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = ANY ('{45298,50914}'::integer[]))
  • Filter: (active AND ((parent_id IS NULL) OR (SubPlan 1)))
4.          

SubPlan (for Index Scan)

5. 0.000 0.000 ↓ 0.0

Unique (cost=0.29..8.31 rows=1 width=4) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Index Only Scan using products_pkey on products p1_ (cost=0.29..8.31 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = p0_.parent_id)
7. 0.000 0.000 ↓ 0.0

Materialize (cost=359.12..1,139.62 rows=44,600 width=4) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Unique (cost=359.12..582.12 rows=44,600 width=4) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Sort (cost=359.12..360.24 rows=446 width=4) (actual rows= loops=)

  • Sort Key: (unnest(pal.products))
10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=122.19..339.49 rows=446 width=4) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Index Only Scan using accounts_pkey on accounts a5_ (cost=0.28..8.30 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = 2)
12. 0.000 0.000 ↓ 0.0

Hash Join (cost=121.91..325.62 rows=446 width=68) (actual rows= loops=)

  • Hash Cond: (aup.product_access_list_id = pal.id)
13. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on account_user_products aup (cost=11.75..209.32 rows=446 width=8) (actual rows= loops=)

  • Recheck Cond: (account_id = 2)
14. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_cc1182e99b6b5fba (cost=0.00..11.63 rows=446 width=0) (actual rows= loops=)

  • Index Cond: (account_id = 2)
15. 0.000 0.000 ↓ 0.0

Hash (cost=75.63..75.63 rows=2,763 width=68) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Seq Scan on product_access_lists pal (cost=0.00..75.63 rows=2,763 width=68) (actual rows= loops=)