explain.depesz.com

PostgreSQL's explain analyze made readable

Result: L5QG

Settings

Optimization(s) for this plan:

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

Merge Left Join (cost=1,438,599.97..1,448,511.12 rows=414,903 width=1,103) (actual rows= loops=)

  • Merge Cond: ((o.month = (t4.vip_month)::text) AND ((t3.category)::text = (t4.category)::text) AND ((t3.subtrack)::text = (t4.subtrack)::text) AND ((t3.track)::text = (t4.track)::text) AND (o.customer_id = t4.customer_id) AND ((cg.country_group)::text = (t4.countrygroup)::text))
  • Join Filter: (t2.vip_period_id = t3.vip_period_id)
2. 0.000 0.000 ↓ 0.0

Sort (cost=1,397,978.67..1,399,015.93 rows=414,903 width=1,104) (actual rows= loops=)

  • Sort Key: o.month, t3.category, t3.subtrack, t3.track, o.customer_id, cg.country_group
3. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=432,762.76..959,346.21 rows=414,903 width=1,104) (actual rows= loops=)

  • Hash Cond: (o.country_group_id = cg.id)
4. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=432,760.14..956,294.06 rows=414,903 width=1,098) (actual rows= loops=)

  • Hash Cond: (((o.sku)::text = (t3.sku)::text) AND (t2.vip_period_id = t3.vip_period_id))
5. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=426,474.78..726,804.25 rows=414,903 width=1,044) (actual rows= loops=)

  • Hash Cond: (o.id = t2.orderdetails_id)
6. 0.000 0.000 ↓ 0.0

Seq Scan on od_month o (cost=0.00..142,450.03 rows=414,903 width=988) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Hash (cost=320,576.02..320,576.02 rows=4,556,301 width=64) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Seq Scan on orderdetailsadditional t2 (cost=0.00..320,576.02 rows=4,556,301 width=64) (actual rows= loops=)

  • Filter: (vip_period_id = ANY ('{14,15,16,17}'::integer[]))
9. 0.000 0.000 ↓ 0.0

Hash (cost=4,209.01..4,209.01 rows=77,690 width=70) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Index Scan using indx_ciscovipskus_vip_period_id on ciscovipskus t3 (cost=0.42..4,209.01 rows=77,690 width=70) (actual rows= loops=)

  • Index Cond: (vip_period_id = ANY ('{14,15,16,17}'::integer[]))
11. 0.000 0.000 ↓ 0.0

Hash (cost=1.72..1.72 rows=72 width=14) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Seq Scan on countrygroup cg (cost=0.00..1.72 rows=72 width=14) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Materialize (cost=40,621.30..41,283.88 rows=132,515 width=88) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Sort (cost=40,621.30..40,952.59 rows=132,515 width=88) (actual rows= loops=)

  • Sort Key: t4.vip_month, t4.category, t4.subtrack, t4.track, t4.customer_id, t4.countrygroup
15. 0.000 0.000 ↓ 0.0

Seq Scan on vip_payout_report t4 (cost=0.00..23,005.06 rows=132,515 width=88) (actual rows= loops=)