explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

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

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

2.          

CTE cte_cart_prices

3. 0.554 1.892 ↓ 12.0 12 1

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

4. 0.104 1.338 ↓ 84.0 84 1

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

5. 0.040 1.066 ↓ 84.0 84 1

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

6. 0.031 0.774 ↓ 84.0 84 1

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

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

8. 0.046 0.184 ↓ 84.0 84 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
9. 0.032 0.138 ↓ 84.0 84 1

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

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

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
12. 0.030 0.030 ↑ 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.011..0.030 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.050 1.961 ↓ 12.0 12 1

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

17. 1.911 1.911 ↓ 12.0 12 1

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