explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5xiy : Optimization for: Optimization for: plan #Asx7; plan #5Dnd

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1,204.383 1,204.383 ↓ 12.0 12 1

CTE Scan on cte_cart_summary s (cost=114.52..114.68 rows=1 width=952) (actual time=1,204.279..1,204.383 rows=12 loops=1)

2.          

CTE cte_cart_prices

3. 0.646 1,204.142 ↓ 12.0 12 1

HashAggregate (cost=114.23..114.41 rows=1 width=671) (actual time=1,204.111..1,204.142 rows=12 loops=1)

4. 0.120 1,203.496 ↓ 84.0 84 1

Nested Loop (cost=80.36..114.00 rows=1 width=671) (actual time=1,202.889..1,203.496 rows=84 loops=1)

5. 0.067 1,203.208 ↓ 84.0 84 1

Nested Loop (cost=79.94..105.47 rows=1 width=667) (actual time=1,202.871..1,203.208 rows=84 loops=1)

6. 0.050 1,202.889 ↓ 84.0 84 1

Hash Right Join (cost=79.51..97.02 rows=1 width=634) (actual time=1,202.847..1,202.889 rows=84 loops=1)

  • Hash Cond: (((p.cart_id)::bpchar = (t.cart_id)::bpchar) AND ((p.cart_item_id)::bpchar = (t.cart_item_id)::bpchar))
7. 1,202.582 1,202.582 ↓ 0.0 0 1

Function Scan on priv_order_allocated_asset_funds p (cost=0.25..10.25 rows=1,000 width=580) (actual time=1,202.582..1,202.582 rows=0 loops=1)

8. 0.073 0.257 ↓ 84.0 84 1

Hash (cost=79.24..79.24 rows=1 width=135) (actual time=0.257..0.257 rows=84 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
9. 0.052 0.184 ↓ 84.0 84 1

Hash Join (cost=66.00..79.24 rows=1 width=135) (actual time=0.078..0.184 rows=84 loops=1)

  • Hash Cond: ((b.order_item_id)::bpchar = (t.order_item_id)::bpchar)
10. 0.084 0.084 ↓ 1.2 84 1

Index Scan using ix_ord_orders_order_id on ord_item_details b (cost=0.56..13.53 rows=69 width=73) (actual time=0.021..0.084 rows=84 loops=1)

  • Index Cond: ((order_id)::bpchar = 'OR18110003408171'::bpchar)
  • Filter: (is_active IS TRUE)
11. 0.010 0.048 ↑ 1.5 12 1

Hash (cost=65.22..65.22 rows=18 width=113) (actual time=0.048..0.048 rows=12 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
12. 0.038 0.038 ↑ 1.5 12 1

Index Scan using ix_ord_items_order_id on ord_items t (cost=0.43..65.22 rows=18 width=113) (actual time=0.012..0.038 rows=12 loops=1)

  • Index Cond: ((order_id)::bpchar = 'OR18110003408171'::bpchar)
  • Filter: (is_active IS TRUE)
13. 0.252 0.252 ↑ 1.0 1 84

Index Scan using pk_ord_orders on ord_orders s_1 (cost=0.43..8.45 rows=1 width=67) (actual time=0.003..0.003 rows=1 loops=84)

  • Index Cond: ((order_id)::bpchar = 'OR18110003408171'::bpchar)
  • Filter: (is_active IS TRUE)
14. 0.168 0.168 ↑ 1.0 1 84

Index Scan using pk_acct_accounts on acct_accounts n (cost=0.42..8.44 rows=1 width=21) (actual time=0.002..0.002 rows=1 loops=84)

  • Index Cond: ((account_id)::bpchar = (t.account_id)::bpchar)
15.          

CTE cte_cart_summary

16. 0.062 1,204.226 ↓ 12.0 12 1

HashAggregate (cost=0.10..0.11 rows=1 width=980) (actual time=1,204.214..1,204.226 rows=12 loops=1)

17. 1,204.164 1,204.164 ↓ 12.0 12 1

CTE Scan on cte_cart_prices cp (cost=0.00..0.02 rows=1 width=980) (actual time=1,204.116..1,204.164 rows=12 loops=1)