explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Xup5

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

Nested Loop (cost=1,001.00..918,871.36 rows=79 width=240) (actual rows= loops=)

  • Join Filter: (ml.to_stock_type = st_to.stock_type_id)
2.          

CTE reason

3. 0.000 0.000 ↓ 0.0

Append (cost=0.00..0.28 rows=14 width=36) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

18.          

CTE stock_type

19. 0.000 0.000 ↓ 0.0

Append (cost=0.00..0.12 rows=6 width=36) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=36) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,000.60..918,856.87 rows=101 width=176) (actual rows= loops=)

  • Join Filter: (ml.from_stock_type = st_from.stock_type_id)
27. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,000.60..918,839.13 rows=131 width=144) (actual rows= loops=)

  • Join Filter: (ml.reason = reason.reason)
28. 0.000 0.000 ↓ 0.0

Gather Merge (cost=1,000.60..918,747.64 rows=290 width=112) (actual rows= loops=)

  • Workers Planned: 2
29. 0.000 0.000 ↓ 0.0

Parallel Index Scan using movement_log_at_idx on movement_log ml (cost=0.57..917,714.14 rows=121 width=112) (actual rows= loops=)

  • Index Cond: (at >= (LOCALTIMESTAMP - '1 mon'::interval month))
  • Filter: ((user_id IS NOT NULL) AND (reason <> 35) AND (warehouse_id = '15431806189000'::bigint) AND (item_id = 155456566))
30. 0.000 0.000 ↓ 0.0

CTE Scan on reason (cost=0.00..0.28 rows=14 width=36) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

CTE Scan on stock_type st_from (cost=0.00..0.12 rows=6 width=36) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

CTE Scan on stock_type st_to (cost=0.00..0.12 rows=6 width=36) (actual rows= loops=)