explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7euk : Optimization for: Optimization for: plan #Shon; plan #bzw

Settings

Optimization path:

Optimization(s) for this plan:

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

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

2.          

CTE cte_cart_prices

3. 0.552 3.689 ↓ 12.0 12 1

HashAggregate (cost=114.23..114.41 rows=1 width=671) (actual time=3.674..3.689 rows=12 loops=1)

4. 0.103 3.137 ↓ 84.0 84 1

Nested Loop (cost=80.36..114.00 rows=1 width=671) (actual time=2.583..3.137 rows=84 loops=1)

5. 0.035 2.866 ↓ 84.0 84 1

Nested Loop (cost=79.94..105.47 rows=1 width=667) (actual time=2.557..2.866 rows=84 loops=1)

6. 0.045 2.579 ↓ 84.0 84 1

Hash Right Join (cost=79.51..97.02 rows=1 width=634) (actual time=2.543..2.579 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. 2.329 2.329 ↓ 0.0 0 1

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

8. 0.030 0.205 ↓ 84.0 84 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
9. 0.046 0.175 ↓ 84.0 84 1

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

  • Hash Cond: ((b.order_item_id)::bpchar = (t.order_item_id)::bpchar)
10. 0.080 0.080 ↓ 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.024..0.080 rows=84 loops=1)

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
12. 0.043 0.043 ↑ 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.015..0.043 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.057 3.769 ↓ 12.0 12 1

HashAggregate (cost=0.10..0.11 rows=1 width=980) (actual time=3.757..3.769 rows=12 loops=1)

17. 3.712 3.712 ↓ 12.0 12 1

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