explain.depesz.com

PostgreSQL's explain analyze made readable

Result: v3xk

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

Hash Left Join (cost=550,589.02..3,545,720.40 rows=19,926,214 width=1,047) (actual rows= loops=)

  • Hash Cond: (vw.order_id = lh.order_id)
2. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=27,348.20..2,920,350.02 rows=19,926,214 width=1,043) (actual rows= loops=)

  • Hash Cond: (vw.sales_person_master_id = ss.sales_split_id)
3. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=22,187.53..2,682,816.09 rows=19,926,214 width=1,035) (actual rows= loops=)

  • Merge Cond: (vw.order_id = order_to_deal.order_id)
4. 0.000 0.000 ↓ 0.0

Index Scan using idx_vw_sphd_order_id on vw_spot_and_header vw (cost=0.44..2,316,086.65 rows=19,926,214 width=1,023) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Materialize (cost=21,214.21..22,069.89 rows=171,136 width=16) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Sort (cost=21,214.21..21,642.05 rows=171,136 width=16) (actual rows= loops=)

  • Sort Key: order_to_deal.order_id
7. 0.000 0.000 ↓ 0.0

Seq Scan on order_to_deal (cost=0.00..3,412.40 rows=171,136 width=16) (actual rows= loops=)

  • Filter: (is_impression_adjustment = 0)
8. 0.000 0.000 ↓ 0.0

Hash (cost=4,746.11..4,746.11 rows=33,165 width=8) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,979.12..4,746.11 rows=33,165 width=8) (actual rows= loops=)

  • Hash Cond: (ssp.sales_split_id = ss.sales_split_id)
10. 0.000 0.000 ↓ 0.0

Hash Join (cost=424.94..2,735.91 rows=33,165 width=8) (actual rows= loops=)

  • Hash Cond: (ssp.sales_person_id = sp.sales_person_id)
11. 0.000 0.000 ↓ 0.0

Seq Scan on sales_split_sales_person ssp (cost=0.00..1,854.95 rows=33,165 width=8) (actual rows= loops=)

  • Filter: (is_primary = 1)
12. 0.000 0.000 ↓ 0.0

Hash (cost=389.21..389.21 rows=2,859 width=8) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Hash Join (cost=281.31..389.21 rows=2,859 width=8) (actual rows= loops=)

  • Hash Cond: (sp.user_id = du.user_id)
14. 0.000 0.000 ↓ 0.0

Seq Scan on sales_person sp (cost=0.00..68.59 rows=2,859 width=8) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Hash (cost=193.57..193.57 rows=7,019 width=4) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Index Only Scan using idx_stage_harbor_user_user_id on "user" du (cost=0.28..193.57 rows=7,019 width=4) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Hash (cost=1,030.19..1,030.19 rows=41,919 width=4) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Seq Scan on sales_split ss (cost=0.00..1,030.19 rows=41,919 width=4) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash (cost=522,881.23..522,881.23 rows=28,767 width=4) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

HashAggregate (cost=522,305.89..522,593.56 rows=28,767 width=4) (actual rows= loops=)

  • Group Key: lh.order_id
21. 0.000 0.000 ↓ 0.0

Seq Scan on lh_spots_to_convert lh (cost=0.00..519,437.86 rows=1,147,213 width=4) (actual rows= loops=)

  • Filter: (((clean_product_name)::text <> 'IMPRESSION ADJUSTMENT'::text) AND (source_spot_id_desc = 'spot_id - spot'::text))