explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5Sc

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

Subquery Scan on a (cost=822,420.58..822,587.10 rows=67 width=19) (actual rows= loops=)

  • Filter: (a.qty < '0'::double precision)
2.          

CTE article_with_needs

3. 0.000 0.000 ↓ 0.0

HashAggregate (cost=248,205.16..249,822.62 rows=161,746 width=24) (actual rows= loops=)

  • Group Key: lacroix_mrp_1.article, lacroix_mrp_1.division, lacroix_mrp_1.buyer
4. 0.000 0.000 ↓ 0.0

Append (cost=0.00..236,074.22 rows=1,617,459 width=24) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Seq Scan on lacroix_mrp lacroix_mrp_1 (cost=0.00..160,926.62 rows=972,002 width=24) (actual rows= loops=)

  • Filter: ((quantity < '0'::double precision) AND (effective_at <= (('now'::cstring)::date + '70 days'::interval)))
6. 0.000 0.000 ↓ 0.0

Seq Scan on eolane_mrp eolane_mrp_1 (cost=0.00..44,474.31 rows=421,285 width=22) (actual rows= loops=)

  • Filter: ((quantity < '0'::double precision) AND (effective_at <= (('now'::cstring)::date + '70 days'::interval)))
7. 0.000 0.000 ↓ 0.0

Seq Scan on allcircuits_tis_mrp allcircuits_tis_mrp_1 (cost=0.00..30,673.29 rows=224,172 width=29) (actual rows= loops=)

  • Filter: ((quantity < '0'::double precision) AND (effective_at <= (('now'::cstring)::date + '70 days'::interval)))
8. 0.000 0.000 ↓ 0.0

Unique (cost=572,597.96..572,761.98 rows=200 width=32) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Sort (cost=572,597.96..572,679.97 rows=32,804 width=32) (actual rows= loops=)

  • Sort Key: lacroix_mrp.article
10. 0.000 0.000 ↓ 0.0

WindowAgg (cost=569,399.31..570,137.40 rows=32,804 width=32) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Sort (cost=569,399.31..569,481.32 rows=32,804 width=32) (actual rows= loops=)

  • Sort Key: lacroix_mrp.division, lacroix_mrp.article, lacroix_mrp.normalized_effective_at
12. 0.000 0.000 ↓ 0.0

Merge Join (cost=548,768.50..566,938.75 rows=32,804 width=32) (actual rows= loops=)

  • Merge Cond: ((lacroix_mrp.article = article_with_needs.article) AND (lacroix_mrp.division = article_with_needs.division) AND (lacroix_mrp.buyer = article_with_needs.buyer))
13. 0.000 0.000 ↓ 0.0

Sort (cost=531,539.82..535,596.01 rows=1,622,475 width=40) (actual rows= loops=)

  • Sort Key: lacroix_mrp.article, lacroix_mrp.division, lacroix_mrp.buyer
14. 0.000 0.000 ↓ 0.0

Append (cost=0.00..364,183.43 rows=1,622,475 width=40) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Seq Scan on lacroix_mrp (cost=0.00..246,813.23 rows=940,987 width=40) (actual rows= loops=)

  • Filter: ((effective_at <= (('now'::cstring)::date + '70 days'::interval)) AND ((type = 'SB'::text) OR (type = 'AR'::text) OR (type = 'RP'::text) OR (type = 'WB'::text) OR (type = 'LK'::text) OR (type = 'LB'::text) OR (type = 'QM'::text) OR (type = 'BB'::text) OR (type = 'LA'::text) OR (type = 'LE'::text)))
16. 0.000 0.000 ↓ 0.0

Seq Scan on eolane_mrp (cost=0.00..70,100.61 rows=457,330 width=38) (actual rows= loops=)

  • Filter: ((effective_at <= (('now'::cstring)::date + '70 days'::interval)) AND ((type = 'SB'::text) OR (type = 'AR'::text) OR (type = 'RP'::text) OR (type = 'WB'::text) OR (type = 'LK'::text) OR (type = 'LB'::text) OR (type = 'QM'::text) OR (type = 'BB'::text) OR (type = 'LA'::text) OR (type = 'LE'::text)))
17. 0.000 0.000 ↓ 0.0

Seq Scan on allcircuits_tis_mrp (cost=0.00..47,269.58 rows=224,158 width=45) (actual rows= loops=)

  • Filter: ((effective_at <= (('now'::cstring)::date + '70 days'::interval)) AND ((type = 'SB'::text) OR (type = 'AR'::text) OR (type = 'RP'::text) OR (type = 'WB'::text) OR (type = 'LK'::text) OR (type = 'LB'::text) OR (type = 'QM'::text) OR (type = 'BB'::text) OR (type = 'LA'::text) OR (type = 'LE'::text)))
18. 0.000 0.000 ↓ 0.0

Sort (cost=17,228.67..17,633.04 rows=161,746 width=96) (actual rows= loops=)

  • Sort Key: article_with_needs.article, article_with_needs.division, article_with_needs.buyer
19. 0.000 0.000 ↓ 0.0

CTE Scan on article_with_needs (cost=0.00..3,234.92 rows=161,746 width=96) (actual rows= loops=)